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-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel AbstractServiceKernel.java
Date Sun, 25 Aug 2002 12:12:26 GMT
donaldp     2002/08/25 05:12:26

  Modified:    containerkit/src/java/org/apache/excalibur/containerkit/kernel
                        AbstractServiceKernel.java
  Log:
  Get CVS compiling again
  
  Revision  Changes    Path
  1.27      +35 -13    jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/AbstractServiceKernel.java
  
  Index: AbstractServiceKernel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/AbstractServiceKernel.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- AbstractServiceKernel.java	24 Aug 2002 08:55:07 -0000	1.26
  +++ AbstractServiceKernel.java	25 Aug 2002 12:12:26 -0000	1.27
  @@ -9,6 +9,8 @@
   
   import java.util.ArrayList;
   import java.util.List;
  +import java.util.Map;
  +import java.util.HashMap;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.activity.Disposable;
  @@ -62,6 +64,13 @@
        * produced.
        */
       private final DependencyMap m_dependencyMap = new DependencyMap();
  +    /**
  +     * The resource provider to use to provide resources
  +     * for all the components.
  +     */
  +    private Map m_entrySet = new HashMap();
  +
  +    //private PhaseProcessor m_processor;
   
       /**
        * Initialization of the kernel.  The implementation will request
  @@ -76,6 +85,8 @@
           m_factory = prepareFactory();
           m_resourceProvider = prepareResourceProvider();
           m_lifecycleHelper = prepareLifecycleHelper();
  +        //m_processor = new PhaseProcessor();
  +        //setupLogger( m_processor, "processor" );
       }
   
       /**
  @@ -126,7 +137,7 @@
       protected final void startupAllComponents()
           throws Exception
       {
  -        final ComponentEntry[] components = m_dependencyMap.getStartupGraph( m_store );
  +        final ComponentProfile[] components = m_dependencyMap.getStartupGraph( m_store
);
           processComponents( true, components );
       }
   
  @@ -137,7 +148,7 @@
       protected final void shutdownAllComponents()
           throws Exception
       {
  -        final ComponentEntry[] components = m_dependencyMap.getShutdownGraph(m_store);
  +        final ComponentProfile[] components = m_dependencyMap.getShutdownGraph(m_store);
           processComponents( false, components );
       }
   
  @@ -149,8 +160,8 @@
       protected final void startupComponent( final String name )
           throws Exception
       {
  -        final ComponentEntry entry = m_store.getComponent( name );
  -        final ComponentEntry[] components =
  +        final ComponentProfile entry = m_store.getComponent( name );
  +        final ComponentProfile[] components =
               m_dependencyMap.getProviderGraph( entry, m_store );
           processComponents( true, components );
       }
  @@ -163,8 +174,8 @@
       protected final void shutdownComponent( final String name )
           throws Exception
       {
  -        final ComponentEntry entry = m_store.getComponent( name );
  -        final ComponentEntry[] components =
  +        final ComponentProfile entry = m_store.getComponent( name );
  +        final ComponentProfile[] components =
               m_dependencyMap.getConsumerGraph( entry, m_store );
           processComponents( false, components );
       }
  @@ -192,12 +203,13 @@
           final ComponentInfo info = m_factory.createInfo( component.getImplementationKey()
);
           final ComponentProfile profile = new ComponentProfile( info, component );
           final ComponentEntry entry = new ComponentEntry( profile );
  -        m_store.addComponent( entry );
  +        m_entrySet.put( component.getName(), entry );
  +        m_store.addComponent( profile );
       }
   
       public final Object getComponent( final String name )
       {
  -        final ComponentEntry entry = m_store.getComponent( name );
  +        final ComponentEntry entry = (ComponentEntry)m_entrySet.get( name );
           if( null != entry )
           {
               return entry.getObject();
  @@ -218,7 +230,7 @@
        *         through the phases
        */
       private void processComponents( final boolean startup,
  -                                    final ComponentEntry[] components )
  +                                    final ComponentProfile[] components )
           throws Exception
       {
           processComponentsNotice( components, startup );
  @@ -253,6 +265,16 @@
           }
       }
   
  +    private void processComponent( final ComponentProfile component,
  +                                   final boolean startup )
  +        throws Exception
  +    {
  +        final String name = component.getMetaData().getName();
  +        final ComponentEntry entry =
  +            (ComponentEntry)m_entrySet.get( name );
  +        processComponent( entry, startup );
  +    }
  +
       /**
        * Process a component through a lifecycle phase
        * (ie startup or shutdown). If it is startup phase then
  @@ -321,7 +343,7 @@
        * @param order the order the components will be processed in
        * @param startup true if application startup phase, false if shutdown phase
        */
  -    private void processComponentsNotice( final ComponentEntry[] order,
  +    private void processComponentsNotice( final ComponentProfile[] order,
                                             final boolean startup )
       {
           if( getLogger().isInfoEnabled() )
  @@ -331,8 +353,8 @@
               final List pathList = new ArrayList();
               for( int i = 0; i < order.length; i++ )
               {
  -                ComponentEntry componentEntry = order[ i ];
  -                pathList.add( componentEntry.getProfile().getMetaData().getName() );
  +                ComponentProfile componentEntry = order[ i ];
  +                pathList.add( componentEntry.getMetaData().getName() );
               }
   
               final String message =
  
  
  

--
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