avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-smp/src/repository/james block.xml
Date Sun, 04 May 2003 17:21:05 GMT
mcconnell    2003/05/04 10:21:05

  Modified:    merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl
                        StandardServiceManager.java
               merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl
                        BlockInvocationHandler.java
               merlin/merlin-smp/src/examples/afs/simple-servlet/src/webapp/BLOCK-INF
                        block.xml
               merlin/merlin-smp/src/repository/james block.xml
  Log:
  Updates to better handle virtual service identity.
  
  Revision  Changes    Path
  1.2       +17 -6     avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl/StandardServiceManager.java
  
  Index: StandardServiceManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl/StandardServiceManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StandardServiceManager.java	29 Apr 2003 23:36:51 -0000	1.1
  +++ StandardServiceManager.java	4 May 2003 17:21:05 -0000	1.2
  @@ -92,7 +92,8 @@
   
       /**
        * Construct a new ServiceManager.
  -     * @param profile the component profile
  +     * @param appliance the appliance handling the component
  +     *   to be serviced
        */
       public StandardServiceManager( Appliance appliance )
       {
  @@ -140,15 +141,15 @@
           try
           {
               Object object = provider.resolve( this );
  -            m_table.put( object, provider );
  +            m_table.put( getKey( object ), provider );
               return object;
           } 
           catch( Throwable e )
           {
               final String error =
  -                    "Unexpected internal error while accessing a service provider in appliance:
"
  -                    + m_appliance
  -                    + " for the role: " + role;
  +              "Unexpected internal error while accessing a service provider in appliance:
"
  +              + m_appliance
  +              + " for the role: " + role;
               throw new ServiceException( role, error, e );
           }
       }
  @@ -159,7 +160,12 @@
        */
       public void release( Object object )
       {
  -        Appliance provider = (Appliance) m_table.get( object );
  +        if( object == null )
  +        {
  +            return;
  +        }
  +
  +        Appliance provider = (Appliance) m_table.get( getKey( object ) );
           if( provider == null )
           {
               if( getLogger().isWarnEnabled() )
  @@ -177,5 +183,10 @@
               provider.release( object, this );
               m_table.remove( object );
           }
  +    }
  +
  +    private String getKey( Object object )
  +    {
  +        return object.getClass().getName() + "/" + System.identityHashCode( object );
       }
   }
  
  
  
  1.3       +6 -1      avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/BlockInvocationHandler.java
  
  Index: BlockInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/BlockInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BlockInvocationHandler.java	29 Apr 2003 21:07:35 -0000	1.2
  +++ BlockInvocationHandler.java	4 May 2003 17:21:05 -0000	1.3
  @@ -152,4 +152,9 @@
               }
           }
       }
  +
  +    public int hashCode()
  +    {
  +        return m_block.hashCode() + m_instance.hashCode();
  +    }
   }
  
  
  
  1.4       +6 -0      avalon-sandbox/merlin/merlin-smp/src/examples/afs/simple-servlet/src/webapp/BLOCK-INF/block.xml
  
  Index: block.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-smp/src/examples/afs/simple-servlet/src/webapp/BLOCK-INF/block.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- block.xml	15 Apr 2003 03:07:03 -0000	1.3
  +++ block.xml	4 May 2003 17:21:05 -0000	1.4
  @@ -6,6 +6,12 @@
       <version>1.0</version>
     </info>
   
  +  <services>
  +    <service type="org.apache.bank.Bank">
  +      <source>banking/bank</source>
  +    </service>
  +  </services>
  +
     <implementation>
       <container name="banking">
         <component name="bank" class="org.apache.bank.impl.BankProvider" activation="startup">
  
  
  
  1.8       +2 -2      avalon-sandbox/merlin/merlin-smp/src/repository/james/block.xml
  
  Index: block.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-smp/src/repository/james/block.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- block.xml	1 May 2003 22:00:26 -0000	1.7
  +++ block.xml	4 May 2003 17:21:05 -0000	1.8
  @@ -16,8 +16,8 @@
      of a container using these services.
      -->
     <services>
  -    <service name="org.apache.james.services.MailServer" version="1.0" />
  -    <service name="org.apache.mailet.MailetContext" version="1.0" />
  +    <service type="org.apache.james.services.MailServer" version="1.0" />
  +    <service type="org.apache.mailet.MailetContext" version="1.0" />
     </services>
   
      <!--
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message