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 Tue, 25 Jun 2002 07:42:41 GMT
donaldp     2002/06/25 00:42:41

  Modified:    containerkit/src/java/org/apache/excalibur/containerkit/kernel
                        AbstractServiceKernel.java
  Log:
  Add getComponent() method to get at internal component
  
  Revision  Changes    Path
  1.12      +36 -25    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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractServiceKernel.java	25 Jun 2002 05:01:56 -0000	1.11
  +++ AbstractServiceKernel.java	25 Jun 2002 07:42:41 -0000	1.12
  @@ -12,10 +12,8 @@
   import java.util.List;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.activity.Startable;
  -import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.activity.Initializable;
   import org.apache.excalibur.containerkit.dependency.DependencyMap;
   import org.apache.excalibur.containerkit.lifecycle.LifecycleHelper;
   import org.apache.excalibur.containerkit.lifecycle.ResourceProvider;
  @@ -24,7 +22,7 @@
   /**
    * The <code>AbstractServiceKernel</code> defines an application scope through
    * the aggregation of a set of container entries and the exposure of operations
  - * supporting the collective startup and shutdown of registered entries. 
  + * supporting the collective startup and shutdown of registered entries.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
  @@ -32,7 +30,7 @@
    */
   public abstract class AbstractServiceKernel
       extends AbstractLogEnabled
  -    implements Contextualizable, Initializable, Startable
  +    implements Initializable
   {
       private final static Resources REZ =
           ResourceManager.getPackageResources( AbstractServiceKernel.class );
  @@ -63,7 +61,7 @@
       /**
        * Initialization of the kernel.  The implementation will request
        * resource provider preparation via the {@link #prepareResourceProvider}
  -     * method that must be implemeted by a kernel derived from this abstract 
  +     * method that must be implemeted by a kernel derived from this abstract
        * class.
        * @throws Exception if an error occurs during kernel initialization
        */
  @@ -83,10 +81,10 @@
           return lifecycleHelper;
       }
   
  -   /**
  -    * Request startup of all components.
  -    * @exception Exception if there is an error during startup
  -    */
  +    /**
  +     * Request startup of all components.
  +     * @exception Exception if there is an error during startup
  +     */
       protected final void startupAllComponents()
           throws Exception
       {
  @@ -94,10 +92,10 @@
           processComponents( true, components );
       }
   
  -   /**
  -    * Request shutdown of all components.
  -    * @exception Exception if there is an error during shutdown
  -    */
  +    /**
  +     * Request shutdown of all components.
  +     * @exception Exception if there is an error during shutdown
  +     */
       protected final void shutdownAllComponents()
           throws Exception
       {
  @@ -105,11 +103,11 @@
           processComponents( false, components );
       }
   
  -   /**
  -    * Request startup of a named component.
  -    * @param name the name of the component to startup
  -    * @exception Exception if there is an error during component startup
  -    */
  +    /**
  +     * Request startup of a named component.
  +     * @param name the name of the component to startup
  +     * @exception Exception if there is an error during component startup
  +     */
       protected final void startupComponent( final String name )
           throws Exception
       {
  @@ -119,11 +117,11 @@
           processComponents( true, components );
       }
   
  -   /**
  -    * Request shutdown of a named component.
  -    * @param name the name of the component to shutdown
  -    * @exception Exception if there is an error during component shutdown
  -    */
  +    /**
  +     * Request shutdown of a named component.
  +     * @param name the name of the component to shutdown
  +     * @exception Exception if there is an error during component shutdown
  +     */
       protected final void shutdownComponent( final String name )
           throws Exception
       {
  @@ -146,6 +144,19 @@
           final ComponentEntry entry = new ComponentEntry( component );
           m_entrys.put( name, entry );
           m_dependencyMap.add( component );
  +    }
  +
  +    protected final Object getComponent( final String name )
  +    {
  +        final ComponentEntry entry = (ComponentEntry)m_entrys.get( name );
  +        if( null != entry )
  +        {
  +            return entry.getObject();
  +        }
  +        else
  +        {
  +            return null;
  +        }
       }
   
       /**
  
  
  

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