avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application BlockEntry.java LifecycleHelper.java State.java
Date Tue, 14 May 2002 12:02:50 GMT
donaldp     02/05/14 05:02:50

  Modified:    src/java/org/apache/avalon/phoenix/components/application
                        BlockEntry.java LifecycleHelper.java
  Removed:     src/java/org/apache/avalon/phoenix/components/application
                        State.java
  Log:
  Start integrating the generic container infrastructure into Application component.
  
  Revision  Changes    Path
  1.8       +15 -21    jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockEntry.java
  
  Index: BlockEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockEntry.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- BlockEntry.java	10 May 2002 11:46:33 -0000	1.7
  +++ BlockEntry.java	14 May 2002 12:02:49 -0000	1.8
  @@ -8,6 +8,7 @@
   package org.apache.avalon.phoenix.components.application;
   
   import org.apache.avalon.phoenix.Block;
  +import org.apache.avalon.phoenix.components.lifecycle.ComponentEntry;
   import org.apache.avalon.phoenix.metadata.BlockMetaData;
   import org.apache.avalon.phoenix.metainfo.BlockInfo;
   import org.apache.avalon.phoenix.metainfo.ServiceDescriptor;
  @@ -18,16 +19,15 @@
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    */
   public class BlockEntry
  +    extends ComponentEntry
   {
       private BlockMetaData m_blockMetaData;
       private BlockInvocationHandler m_invocationHandler;
  -    private Block m_block;
  -    private State m_state;
   
       public BlockEntry( final BlockMetaData blockMetaData )
       {
  +        super( blockMetaData.getName() );
           m_blockMetaData = blockMetaData;
  -        setState( State.VOID );
       }
   
       public BlockMetaData getMetaData()
  @@ -35,32 +35,27 @@
           return m_blockMetaData;
       }
   
  -    public synchronized State getState()
  -    {
  -        return m_state;
  -    }
  -
  -    public synchronized void setState( final State state )
  +    public synchronized Block getBlock()
       {
  -        m_state = state;
  +        return (Block)getObject();
       }
   
  -    public synchronized Block getBlock()
  +    public synchronized void setBlock( final Block block )
       {
  -        return m_block;
  +        setObject( block );
       }
   
  -    public synchronized void setBlock( final Block block )
  +    public synchronized void setObject( final Object object )
       {
           invalidate();
   
  -        if( null != block )
  +        if( null != object )
           {
               final BlockInfo blockInfo = getMetaData().getBlockInfo();
  -            final Class[] interfaces = getServiceClasses( block, blockInfo.getServices()
);
  +            final Class[] interfaces = getServiceClasses( object, blockInfo.getServices()
);
   
  -            m_invocationHandler = new BlockInvocationHandler( block, interfaces );
  -            m_block = block;
  +            m_invocationHandler = new BlockInvocationHandler( object, interfaces );
  +            super.setObject( object );
           }
       }
   
  @@ -81,13 +76,12 @@
           if( null != m_invocationHandler )
           {
               m_invocationHandler.invalidate();
  +            m_invocationHandler = null;
           }
  -
  -        m_invocationHandler = null;
  -        m_block = null;
  +        super.invalidate();
       }
   
  -    private Class[] getServiceClasses( final Block block, final ServiceDescriptor[] services
)
  +    private Class[] getServiceClasses( final Object block, final ServiceDescriptor[] services
)
       {
           final Class[] classes = new Class[ services.length + 1 ];
           final ClassLoader classLoader = block.getClass().getClassLoader();
  
  
  
  1.38      +1 -0      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/LifecycleHelper.java
  
  Index: LifecycleHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/LifecycleHelper.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- LifecycleHelper.java	14 May 2002 09:17:41 -0000	1.37
  +++ LifecycleHelper.java	14 May 2002 12:02:49 -0000	1.38
  @@ -37,6 +37,7 @@
   import org.apache.avalon.phoenix.BlockEvent;
   import org.apache.avalon.phoenix.BlockListener;
   import org.apache.avalon.phoenix.components.ContainerUtil;
  +import org.apache.avalon.phoenix.components.lifecycle.State;
   import org.apache.avalon.phoenix.interfaces.Application;
   import org.apache.avalon.phoenix.interfaces.ApplicationContext;
   import org.apache.avalon.phoenix.metadata.BlockListenerMetaData;
  
  
  

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


Mime
View raw message