You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/08/22 07:34:31 UTC

cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground Exploitable.java ExploitationManager.java InvalidComponent.java SimpleComponent.java SimpleService.java TerminalComponent.java

mcconnell    2002/08/21 22:34:31

  Modified:    assembly/src/java/org/apache/excalibur/merlin/assembly
                        ContainerManager.java
               assembly/src/java/org/apache/excalibur/playground
                        Exploitable.java ExploitationManager.java
                        InvalidComponent.java SimpleComponent.java
                        SimpleService.java TerminalComponent.java
  Log:
  Cleaning house - checkstyle stuff.
  
  Revision  Changes    Path
  1.23      +43 -25    jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ContainerManager.java
  
  Index: ContainerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ContainerManager.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ContainerManager.java	21 Aug 2002 17:00:51 -0000	1.22
  +++ ContainerManager.java	22 Aug 2002 05:34:31 -0000	1.23
  @@ -9,46 +9,28 @@
   
   import java.io.File;
   import java.util.List;
  -import java.util.Map;
   import java.util.ArrayList;
   import java.util.LinkedList;
   import java.util.Hashtable;
  -import java.util.ArrayList;
  -import java.util.Vector;
   import java.util.Iterator;
  -import org.apache.avalon.framework.CascadingException;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.LogEnabled;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.DefaultContext;
  -import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.configuration.DefaultConfiguration;
  -import org.apache.avalon.framework.configuration.Configurable;
  -import org.apache.avalon.framework.activity.Startable;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.framework.activity.Startable;
  -import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.excalibur.configuration.ConfigurationUtil;
   import org.apache.excalibur.merlin.resource.ResourceException;
   import org.apache.excalibur.merlin.resource.DefaultResource;
   import org.apache.excalibur.merlin.container.Container;
  -import org.apache.excalibur.merlin.container.DefaultContainer;
   import org.apache.excalibur.merlin.resource.LifestyleHandler;
   import org.apache.excalibur.merlin.resource.LifestyleManager;
  -import org.apache.excalibur.merlin.resource.SingletonLifestyleHandler;
  -import org.apache.excalibur.merlin.resource.TransientLifestyleHandler;
   import org.apache.excalibur.merlin.resource.LifecycleHelper;
   import org.apache.excalibur.merlin.resource.DeploymentHelper;
   import org.apache.excalibur.merlin.model.ContainerDescriptor;
   import org.apache.excalibur.merlin.model.ClasspathDescriptor;
   import org.apache.excalibur.merlin.model.LoggingDescriptor;
   import org.apache.excalibur.merlin.model.builder.XMLContainerUtil;
  -import org.apache.excalibur.merlin.model.Category;
   import org.apache.excalibur.merlin.model.CategoriesDescriptor;
   import org.apache.excalibur.merlin.model.Profile;
   import org.apache.excalibur.merlin.model.Resource;
  @@ -60,8 +42,6 @@
   import org.apache.excalibur.meta.info.DependencyDescriptor;
   import org.apache.excalibur.meta.info.ExtensionDescriptor;
   import org.apache.excalibur.meta.info.Type;
  -import org.apache.excalibur.meta.info.builder.TypeBuilder;
  -import org.apache.excalibur.meta.verifier.ComponentVerifier;
   
   /**
    * Classloader for an assembly of components that provides the complete
  @@ -261,6 +241,7 @@
      /**
       * Declaration of the logging manager.
       * @param context the context object containing the inital parameters
  +    * @param ContextException if the context criterai is not met
       */
       public void contextualize( Context context ) throws ContextException
       {
  @@ -281,6 +262,13 @@
       // Initializable
       //=======================================================================
   
  +   /**
  +    * Initialization of the type manager during which the default selector, 
  +    * lifecycle helper, deployment helper, and type registry are established
  +    * and packaged and implicit profiles are built.
  +    *
  +    * @param Exception if an intilization error occurs
  +    */
       public void initialize() throws Exception
       {
           super.initialize();
  @@ -395,11 +383,18 @@
           }
       }
   
  +   /**
  +    * Stops the manager resulting in the stopping of all local componets.
  +    */
       public void stop( )
       {
  -        m_map.getShutdownGraph();
  +        stop( m_map.getShutdownGraph() );
       }
   
  +   /**
  +    * Stope the set of componets matching the supplied profiles.
  +    * @param shutdown the set of profiles to shutdown
  +    */
       public void stop( Profile[] shutdown )
       {
   
  @@ -455,6 +450,9 @@
       // Disposable
       //===================================================================
   
  +   /**
  +    * Request disposal of the manager.
  +    */
       public void dispose()
       {
           // need to complete this ...
  @@ -472,6 +470,12 @@
       // ContainerManager
       //===================================================================
   
  +   /**
  +    * Utility operation that enables the creation of a child type manager.
  +    * @param descriptor the containr descriptor that the child will manage
  +    * @param classpath the classpath to add to the child manager
  +    * @param lifestyles the lifestyle manager to use
  +    */
       public ContainerManager createContainerManager( 
                                    ContainerDescriptor descriptor,
                                    ClasspathDescriptor classpath,
  @@ -635,6 +639,10 @@
           getLocalLogger().debug("added: " + profile );
       }
   
  +   /**
  +    * Returns TRUE if the supplied profile is local to this manager.
  +    * @return the local status of th e profile
  +    */
       public boolean isLocal( Profile profile )
       {
           return m_profiles.containsKey( profile.getName() );
  @@ -666,6 +674,11 @@
           return local;
       }
   
  +   /**
  +    * Returns a set of profiles matching the supplied stage descriptor.
  +    * @param phase the stage desriptor
  +    * @return a set of components capable of supporting the stage interface
  +    */
       public Profile[] getProfiles( StageDescriptor phase )
       {
           Profile[] local = getLocalProfiles( phase );
  @@ -688,7 +701,7 @@
       }
   
      /**
  -    * Return a single profile matching a supplied phase spec.
  +    * Return a single profile matching a supplied stage spec.
       *
       * @param phase the phase specification
       * @return the selected profile
  @@ -703,7 +716,7 @@
       * Return a single profile matching a supplied versioned interface spec 
       * using a supplied selector.
       *
  -    * @param reference a consumer component dependency declaration
  +    * @param dependency a consumer component dependency declaration
       * @return the selected profile
       */
       public Profile getProfile( DependencyDescriptor dependency )
  @@ -802,7 +815,7 @@
       * Returns a new or existing resource using the supplied local profile and context.
       *
       * @param profile the profile
  -    * @param the deployment context
  +    * @param context the deployment context
       * @return a new resource 
       */
       private Resource createResource( Profile profile, Context context ) throws ResourceException
  @@ -852,6 +865,7 @@
       *
       * @param profile the target profile to assemble
       * @param context the assembly context
  +    * @return the assembled resource
       */
       public Resource assemble( Profile profile, Context context ) throws AssemblyException
       {
  @@ -871,6 +885,7 @@
       *
       * @param profile the target profile to assemble
       * @param context the assembly context
  +    * @return the containter manager's updated assembly graph
       */
       public DependencyGraph install( Profile profile, Context context ) throws Exception
       {
  @@ -884,6 +899,7 @@
       *
       * @param profiles the set of profiles constituting the core components
       *    from which the associations between components will be based
  +    * @return the containter manager's updated assembly graph
       */
       public DependencyGraph install( Profile[] profiles ) throws Exception
       {
  @@ -897,6 +913,8 @@
       *
       * @param profiles the set of profiles constituting the core components
       *    from which the associations between components will be based
  +    * @param context the assembly context
  +    * @return the containter manager's updated assembly graph
       */
       public DependencyGraph install( Profile[] profiles, Context context ) throws Exception
       {
  
  
  
  1.2       +10 -0     jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/Exploitable.java
  
  Index: Exploitable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/Exploitable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Exploitable.java	20 Aug 2002 23:23:08 -0000	1.1
  +++ Exploitable.java	22 Aug 2002 05:34:31 -0000	1.2
  @@ -3,10 +3,20 @@
   package org.apache.excalibur.playground;
   
   /**
  + * Another example extension stage interface.
    * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
    */
   public interface Exploitable 
   {
  +   /**
  +    * Method invoked by the extension handler for this type during 
  +    * the create stage.
  +    */
       public void incarnate();
  +
  +   /**
  +    * Method invoked by the extension handler for this type during 
  +    * the destroy stage.
  +    */
       public void etherialize();
   }
  
  
  
  1.2       +19 -1     jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/ExploitationManager.java
  
  Index: ExploitationManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/ExploitationManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExploitationManager.java	20 Aug 2002 23:23:08 -0000	1.1
  +++ ExploitationManager.java	22 Aug 2002 05:34:31 -0000	1.2
  @@ -9,7 +9,9 @@
   import org.apache.avalon.framework.activity.Disposable;
   
   /**
  - * Definition of an extension type.
  + * Definition of an extension handler that handles the Expoitable 
  + * extension stage interface.
  + *
    * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
    */
   public class ExploitationManager extends AbstractLogEnabled implements Creator, Initializable, Disposable
  @@ -19,6 +21,9 @@
       // Initializable
       //=======================================================================
   
  +   /**
  +    * Initialization of the handler.
  +    */
       public void initialize()
       {
           getLogger().info("initialize");
  @@ -28,6 +33,9 @@
       // Disposable
       //=======================================================================
   
  +   /**
  +    * Disposal of the handler.
  +    */
       public void dispose()
       {
           getLogger().info( "dispose" );
  @@ -37,12 +45,22 @@
       // Extension
       //=======================================================================
   
  +   /**
  +    * Handle the creation stage.
  +    * @param object the object to handle
  +    * @param context the extension stage context
  +    */
       public void create( Object object, Context context ) throws Exception
       {
           if( object instanceof Exploitable )
             ((Exploitable)object).incarnate();
       }
   
  +   /**
  +    * Handle the destroy stage.
  +    * @param object the object to handle
  +    * @param context the extension stage context
  +    */
       public void destroy( Object object, Context context )
       {
           if( object instanceof Exploitable )
  
  
  
  1.2       +0 -1      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/InvalidComponent.java
  
  Index: InvalidComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/InvalidComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InvalidComponent.java	20 Aug 2002 23:23:08 -0000	1.1
  +++ InvalidComponent.java	22 Aug 2002 05:34:31 -0000	1.2
  @@ -7,7 +7,6 @@
    *
    * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
    */
  -
   public class InvalidComponent
   {
   }
  
  
  
  1.2       +30 -1     jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/SimpleComponent.java
  
  Index: SimpleComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/SimpleComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleComponent.java	20 Aug 2002 23:23:08 -0000	1.1
  +++ SimpleComponent.java	22 Aug 2002 05:34:31 -0000	1.2
  @@ -18,7 +18,6 @@
    *
    * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
    */
  -
   public class SimpleComponent extends AbstractLogEnabled 
   implements Configurable, Serviceable, Initializable, Startable, SimpleService, Exploitable, Demonstratable, Disposable
   {
  @@ -32,6 +31,10 @@
       // Configurable
       //=======================================================================
   
  +   /**
  +    * Configurate the component.
  +    * @param config the configuration
  +    */
       public void configure( Configuration config )
       {
           getLogger().debug("configure");
  @@ -42,6 +45,10 @@
       // Serviceable
       //=======================================================================
   
  +   /**
  +    * Service the component.
  +    * @param manager the service manager holding the depedent services
  +    */
       public void service( ServiceManager manager ) throws ServiceException
       {
           getLogger().debug( "service" );
  @@ -53,11 +60,17 @@
       // Exploitable
       //=======================================================================
   
  +   /**
  +    * The create stage interface implementation for the Exloitable extension.
  +    */
       public void incarnate() 
       {
           getLogger().info( "incarnation stage" );
       }
   
  +   /**
  +    * The destroy stage interface implementation for the Exloitable extension.
  +    */
       public void etherialize()
       {
           getLogger().info( "etherialize stage" );
  @@ -68,6 +81,10 @@
       // Demonstratable
       //=======================================================================
   
  +   /**
  +    * Prints out the supplied message.
  +    * @param message the message to print
  +    */
       public void demo( String message )
       {
           getLogger().info( message );
  @@ -77,6 +94,9 @@
       // Initializable
       //=======================================================================
   
  +   /**
  +    * Initialization of the component.
  +    */
       public void initialize()
       {
           getLogger().debug("initialize");
  @@ -88,6 +108,8 @@
       //=======================================================================
   
      /**
  +    * Starts the component.
  +    * @exception if an error occurs
       */
       public void start() throws Exception
       {
  @@ -115,6 +137,7 @@
       }
   
      /**
  +    * Stops the component.
       */
       public void stop()
       {
  @@ -133,6 +156,9 @@
       // Disposable
       //=======================================================================
   
  +   /**
  +    * Dispose of the component.
  +    */
       public void dispose()
       {
           getLogger().debug( "dispose" );
  @@ -142,6 +168,9 @@
       // PrimaryService
       //=======================================================================
   
  +   /**
  +    * Prints out the message derived from the configuration.
  +    */
       public void doObjective()
       {
           getLogger().info( "message: " + m_message );
  
  
  
  1.2       +0 -2      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/SimpleService.java
  
  Index: SimpleService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/SimpleService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleService.java	20 Aug 2002 23:23:08 -0000	1.1
  +++ SimpleService.java	22 Aug 2002 05:34:31 -0000	1.2
  @@ -11,8 +11,6 @@
   public interface SimpleService
   {
   
  -    static final String KEY = "org.apache.excalibur.playground.SimpleService";
  -
      /**
       * Execute the prime objective of this services.
       */
  
  
  
  1.2       +6 -1      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/TerminalComponent.java
  
  Index: TerminalComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/TerminalComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TerminalComponent.java	20 Aug 2002 23:23:08 -0000	1.1
  +++ TerminalComponent.java	22 Aug 2002 05:34:31 -0000	1.2
  @@ -11,7 +11,6 @@
    *
    * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
    */
  -
   public class TerminalComponent extends AbstractLogEnabled
   implements BasicService, Disposable
   {
  @@ -20,11 +19,17 @@
       // BasicService
       //=======================================================================
   
  +   /**
  +    * Does something trivial.
  +    */
       public void doPrimeObjective()
       {
           getLogger().info("hello from TerminalComponent");
       }
   
  +   /**
  +    * Disposal of the componet.
  +    */
       public void dispose()
       {
           getLogger().debug( "dispose" );
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>