mcconnell    2002/08/21 22:01:57

  Modified:    assembly/src/java/org/apache/excalibur/playground
                        BasicComponent.java BasicContext.java
                        BasicContextInterface.java BasicService.java
                        ComplexComponent.java CustomContainer.java
                        DemoManager.java Demonstratable.java
                        EmbeddedDemo.java
  Log:
  General javadoc updating.
  
  Revision  Changes    Path
  1.3       +0 -2      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicComponent.java
  
  Index: BasicComponent.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicComponent.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicComponent.java       21 Aug 2002 17:00:52 -0000      1.2
  +++ BasicComponent.java       22 Aug 2002 05:01:57 -0000      1.3
  @@ -19,8 +19,6 @@
    * This is a minimal demonstration component that implements the 
    * <code>BasicService</code> interface and has no dependencies.
    *
  - * @avalon.type lifestyle="singleton" version="1.4"
  - * @avalon.service interface="org.apache.excalibur.playground.BasicService" 
shareable="true"
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
    */
   public class BasicComponent extends AbstractLogEnabled 
  
  
  
  1.3       +7 -1      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicContext.java
  
  Index: BasicContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicContext.java 21 Aug 2002 17:00:52 -0000      1.2
  +++ BasicContext.java 22 Aug 2002 05:01:57 -0000      1.3
  @@ -14,7 +14,9 @@
   import org.apache.avalon.framework.activity.Startable;
   
   /**
  - * This is example of a custom context class.
  + * This is example of a custom context class.  It is used in the demonsteation
  + * of the Merlin context management fraework to show how a context class can be 
  + * supplied to a component declaring a context interface criteria.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
    */
  @@ -32,6 +34,7 @@
       }
    
      /**
  +    * @return the location
       */
       public String getLocation()
       {
  @@ -45,6 +48,9 @@
           }
       }
   
  +   /**
  +    * @return the working directory
  +    */
       public File getWorkingDirectory()
       {
           try
  
  
  
  1.2       +10 -0     
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicContextInterface.java
  
  Index: BasicContextInterface.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicContextInterface.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasicContextInterface.java        20 Aug 2002 23:23:08 -0000      1.1
  +++ BasicContextInterface.java        22 Aug 2002 05:01:57 -0000      1.2
  @@ -7,11 +7,21 @@
   import org.apache.avalon.framework.context.Context;
   
   /**
  + * Simple non-standard Context interface to demonstration context
  + * management at the level of different context types.
  + *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
    */
   public interface BasicContextInterface extends Context
   {
  +   /**
  +    * @return a string containing a location value
  +    */
       public String getLocation();
  +
  +   /**
  +    * @return a file representing the working directory
  +    */
       public File getWorkingDirectory();
   
   }
  
  
  
  1.2       +0 -2      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicService.java
  
  Index: BasicService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/BasicService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasicService.java 20 Aug 2002 23:23:08 -0000      1.1
  +++ BasicService.java 22 Aug 2002 05:01:57 -0000      1.2
  @@ -10,8 +10,6 @@
   public interface BasicService
   {
   
  -   static final String KEY = "org.apache.excalibur.playground.BasicService";
  -
      /**
       * Execute the prime objective of this services.
       */
  
  
  
  1.2       +26 -8     
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/ComplexComponent.java
  
  Index: ComplexComponent.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/ComplexComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ComplexComponent.java     20 Aug 2002 23:23:08 -0000      1.1
  +++ ComplexComponent.java     22 Aug 2002 05:01:57 -0000      1.2
  @@ -14,7 +14,7 @@
   import org.apache.avalon.framework.service.ServiceException;
   
   /**
  - * This is a minimal demonstration component that declares no interface but
  + * This is a demonstration component that declares no interface but
    * has dependecies on two services.  These include SimpleService and 
    * BasicService. 
    *
  @@ -48,7 +48,9 @@
       throws ServiceException
       {
           if( getLogger().isDebugEnabled() )
  -          getLogger().debug("service");
  +        {
  +            getLogger().debug("service");
  +        }
          m_manager = manager;
       }
   
  @@ -61,17 +63,25 @@
       throws Exception
       {       
           if( getLogger().isDebugEnabled() )
  -          getLogger().debug("initialize");
  +        {
  +            getLogger().debug("initialize");
  +        }
   
           //
           // verify current state
           //
   
  -        if( getLogger() == null ) throw new IllegalStateException(
  -          "Logging channel has not been assigned.");
  +        if( getLogger() == null )
  +        {
  +            throw new IllegalStateException(
  +              "Logging channel has not been assigned.");
  +        }
   
  -        if( m_manager == null ) throw new IllegalStateException(
  -          "Manager has not been declared.");
  +        if( m_manager == null ) 
  +        {
  +            throw new IllegalStateException(
  +              "Manager has not been declared.");
  +        }
   
           //
           // lookup the primary service
  @@ -82,7 +92,9 @@
   
           getLogger().getChildLogger("init").debug("ready");
           if( getLogger().isInfoEnabled() )
  -          getLogger().info("ready");
  +        {
  +            getLogger().info("ready");
  +        }
       }
   
       //=======================================================================
  @@ -90,6 +102,8 @@
       //=======================================================================
   
      /**
  +    * Start the component.
  +    * @exception Exception if an error eoccurs
       */
       public void start() throws Exception
       {
  @@ -117,6 +131,7 @@
       }
   
      /**
  +    * Stop the component.
       */
       public void stop()
       {
  @@ -136,6 +151,9 @@
       // Disposable
       //=======================================================================
       
  +   /**
  +    * Dispose of the component.
  +    */
       public void dispose()
       {
           if( getLogger().isDebugEnabled() )
  
  
  
  1.2       +4 -1      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/CustomContainer.java
  
  Index: CustomContainer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/CustomContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomContainer.java      20 Aug 2002 23:23:08 -0000      1.1
  +++ CustomContainer.java      22 Aug 2002 05:01:57 -0000      1.2
  @@ -11,7 +11,6 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
    */
  -
   public class CustomContainer extends DefaultContainer 
   {
   
  @@ -19,6 +18,10 @@
       // Initializable
       //=======================================================================
   
  +   /**
  +    * Initialization of the component.
  +    * @exception Exception if something goes wrong
  +    */
       public void initialize() throws Exception
       {
           getLogger().info("initialization of a custom container");
  
  
  
  1.2       +35 -1     
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/DemoManager.java
  
  Index: DemoManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/DemoManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DemoManager.java  20 Aug 2002 23:23:08 -0000      1.1
  +++ DemoManager.java  22 Aug 2002 05:01:57 -0000      1.2
  @@ -10,7 +10,9 @@
   import org.apache.excalibur.container.lifecycle.Accessor;
   
   /**
  - * Definition of an extension type.
  + * Definition of an extension type that logs messages related to 
  + * all lifestyle stages.
  + *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
    */
   public class DemoManager extends AbstractLogEnabled 
  @@ -21,6 +23,11 @@
       // Initializable
       //=======================================================================
   
  +   /**
  +    * Initialization of the component. Simply demonstrates that this is 
  +    * a real componet that can implement any lifcycle stage in the role of 
  +    * classic component.
  +    */
       public void initialize()
       {
           getLogger().debug("initializing extension");
  @@ -30,6 +37,12 @@
       // Creator
       //=======================================================================
   
  +   /**
  +    * Invoked by a container to handle a create stage action.
  +    * @param target the object to handle
  +    * @param context the context supplied to the extension by container
  +    *   corresponding to its extension context criteria
  +    */
       public void create( Object target, Context context ) throws Exception
       {
           if( target instanceof Demonstratable )
  @@ -38,6 +51,12 @@
                + ", " + Thread.currentThread() );
       }
   
  +   /**
  +    * Invoked by a container to handle a destroy stage action.
  +    * @param target the object to handle
  +    * @param context the context supplied to the extension by container
  +    *   corresponding to its extension context criteria
  +    */
       public void destroy( Object target, Context context )
       {
           if( target instanceof Demonstratable )
  @@ -46,6 +65,12 @@
                + ", " + Thread.currentThread() );
       }
   
  +   /**
  +    * Invoked by a container to handle a access stage action.
  +    * @param target the object to handle
  +    * @param context the context supplied to the extension by container
  +    *   corresponding to its extension context criteria
  +    */
       public void access( Object target, Context context ) throws Exception
       {
           if( target instanceof Demonstratable )
  @@ -54,6 +79,12 @@
                + ", " + Thread.currentThread() );
       }
   
  +   /**
  +    * Invoked by a container to handle a release stage action.
  +    * @param target the object to handle
  +    * @param context the context supplied to the extension by container
  +    *   corresponding to its extension context criteria
  +    */
       public void release( Object target, Context context )
       {
           if( target instanceof Demonstratable )
  @@ -66,6 +97,9 @@
       // Disposable
       //=======================================================================
   
  +   /**
  +    * Disposal of the component.
  +    */
       public void dispose()
       {
           if( getLogger().isDebugEnabled() )
  
  
  
  1.2       +5 -0      
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/Demonstratable.java
  
  Index: Demonstratable.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/Demonstratable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Demonstratable.java       20 Aug 2002 23:23:08 -0000      1.1
  +++ Demonstratable.java       22 Aug 2002 05:01:57 -0000      1.2
  @@ -3,9 +3,14 @@
   package org.apache.excalibur.playground;
   
   /**
  + * A stage interface.
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephen McConnell</a>
    */
   public interface Demonstratable 
   {
  +   /**
  +    * Do something or other.
  +    * @param the stage being applied (as a string)
  +    */
       void demo( String stage );
   }
  
  
  
  1.2       +26 -1     
jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/EmbeddedDemo.java
  
  Index: EmbeddedDemo.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/playground/EmbeddedDemo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EmbeddedDemo.java 20 Aug 2002 23:23:08 -0000      1.1
  +++ EmbeddedDemo.java 22 Aug 2002 05:01:57 -0000      1.2
  @@ -50,6 +50,12 @@
       // Contextualizable
       //=======================================================================
   
  +   /**
  +    * Contextualization phase.
  +    * @param context the context object supplied in accordance with the 
  +    *   context criteria declared for the type
  +    * @exception ContextException if a context related error occurs
  +    */
       public void contextualize( Context context ) throws ContextException
       {
           m_context = context;
  @@ -59,6 +65,10 @@
       // Configurable
       //=======================================================================
   
  +   /**
  +    * Configuration phase.
  +    * @param config the configuration object supplied by the container
  +    */
       public void configure( Configuration config )
       {
           m_configuration = config;
  @@ -68,7 +78,11 @@
       // Initializable
       //=======================================================================
   
  -    public void initialize() throws Exception
  +   /**
  +    * Component initialization.
  +    * @exception Exception if a initialization error occurs
  +    */
  +   public void initialize() throws Exception
       {
           getLogger().info("initialize");
   
  @@ -146,18 +160,29 @@
       // Startable
       //=======================================================================
   
  +   /**
  +    * Starts the component.
  +    * @exception Exception if an startup related error occurs
  +    */
       public void start() throws Exception
       {
           getLogger().info("starting");
           m_kernel.start();
       }
   
  +   /**
  +    * Stops the component.
  +    * @exception Exception if an shutdown related error occurs
  +    */
       public void stop() throws Exception
       {
           getLogger().info("stopping");
           m_kernel.stop();
       }
   
  +   /**
  +    * Disposal of the component.
  +    */
       public void dispose()
       {
           getLogger().debug( "dispose" );
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to