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/14 12:47:53 UTC

cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/container/lifecycle AbstractAccessor.java AbstractCreator.java Accessor.java Creator.java

mcconnell    2002/08/14 03:47:53

  Added:       assembly/src/java/org/apache/excalibur/container/lifecycle
                        AbstractAccessor.java AbstractCreator.java
                        Accessor.java Creator.java
  Log:
  Container indepenent lifecycle interaces and classes.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/container/lifecycle/AbstractAccessor.java
  
  Index: AbstractAccessor.java
  ===================================================================
  /*
  * Copyright (C) The Apache Software Foundation. All rights reserved.
  *
  * This software is published under the terms of the Apache Software License
  * version 1.1, a copy of which has been included with this distribution in
  * the LICENSE.txt file.
  */
  
  package org.apache.excalibur.container.lifecycle;
  
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  
  /**
   * Abstract implementation of a <code>Accessor</code>.
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class AbstractAccessor extends AbstractLogEnabled implements Accessor
  {
  
      //=======================================================================
      // Accessor
      //=======================================================================
  
      /**
       * Access stage handler.
       *
       * @param object the object that is being accessed
       * @param context the context instance required by the access handler
       *    implementation
       * @exception Exception if an error occurs
       */
      public void access( Object object, Context context )
          throws Exception
      {
          if( getLogger() == null )
            return;
  
          if( getLogger().isDebugEnabled() )
          {
              getLogger().debug(
                "accessing " + object.getClass().getName() 
                + "#" + System.identityHashCode( object ));
          }
      }
  
      /**
       * Release stage handler.
       *
       * @param object the object that is being released
       * @param context the context instance required by the release handler
       *    implementation
       */
      public void release( Object object, Context context )
      {
          if( getLogger() == null )
            return;
  
          if( getLogger().isDebugEnabled() )
          {
              getLogger().debug(
                "releasing " + object.getClass().getName() 
                + "#" + System.identityHashCode( object ));
          }
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/container/lifecycle/AbstractCreator.java
  
  Index: AbstractCreator.java
  ===================================================================
  /*
  * Copyright (C) The Apache Software Foundation. All rights reserved.
  *
  * This software is published under the terms of the Apache Software License
  * version 1.1, a copy of which has been included with this distribution in
  * the LICENSE.txt file.
  */
  
  package org.apache.excalibur.container.lifecycle;
  
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  
  /**
   * Abstract implementation of a <code>Creator</code>.
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class AbstractCreator extends AbstractLogEnabled implements Creator
  {
  
      //=======================================================================
      // Creator
      //=======================================================================
  
      /**
       * Create stage handler.
       *
       * @param object the object that is being created
       * @param context the context instance required by the create handler
       *    implementation
       * @exception Exception if an error occurs
       */
      public void create( Object object, Context context )
          throws Exception
      {
          if( getLogger() == null )
            return;
  
          if( getLogger().isDebugEnabled() )
          {
              getLogger().debug(
                "creating " + object.getClass().getName() 
                + "#" + System.identityHashCode( object ));
          }
      }
  
      /**
       * Destroy stage handler.
       *
       * @param object the object that is being destroyed
       * @param context the context instance required by the handler
       *    implementation
       */
      public void destroy( Object object, Context context )
      {
          if( getLogger() == null )
            return;
  
          if( getLogger().isDebugEnabled() )
          {
              getLogger().debug(
                "destroying " + object.getClass().getName() 
                + "#" + System.identityHashCode( object ));
          }
      }
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/container/lifecycle/Accessor.java
  
  Index: Accessor.java
  ===================================================================
  /*
  * Copyright (C) The Apache Software Foundation. All rights reserved.
  *
  * This software is published under the terms of the Apache Software License
  * version 1.1, a copy of which has been included with this distribution in
  * the LICENSE.txt file.
  */
  package org.apache.excalibur.container.lifecycle;
  
  import org.apache.avalon.framework.context.Context;
  
  /**
   * The <code>Accessor</code> interface describes the access and release 
   * stages that occur between a service or component manager and a container 
   * during service deployment.  Lifecycle extensions supporting access 
   * and release stages must implement this interface.
   *
   * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
   * @author <a href="mailto:crafterm@apache.org">Marcus Crafter</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/14 10:47:53 $
   */
  public interface Accessor
  {
      /**
       * Access stage handler.
       *
       * @param object the object that is being accessed
       * @param context the context instance required by the access handler
       *    implementation
       * @exception Exception if an error occurs
       */
      void access( Object object, Context context )
          throws Exception;
  
      /**
       * Release stage handler.
       *
       * @param object the object that is being released
       * @param context the context instance required by the release handler
       *    implementation
       */
      void release( Object object, Context context );
     
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/container/lifecycle/Creator.java
  
  Index: Creator.java
  ===================================================================
  /*
  * Copyright (C) The Apache Software Foundation. All rights reserved.
  *
  * This software is published under the terms of the Apache Software License
  * version 1.1, a copy of which has been included with this distribution in
  * the LICENSE.txt file.
  */
  package org.apache.excalibur.container.lifecycle;
  
  import org.apache.avalon.framework.context.Context;
  
  /**
   * The <code>Creator</code> interface describes the create and destroy 
   * stages that occur between a component and a container 
   * during service management.  Lifecycle extensions supporting create
   * and destroy stages must implement this interface.
   *
   * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
   * @author <a href="mailto:crafterm@apache.org">Marcus Crafter</a>
   * @version CVS $Revision: 1.1 $ $Date: 2002/08/14 10:47:53 $
   */
  public interface Creator
  {
      /**
       * Create stage handler.
       *
       * @param object the object that is being created
       * @param context the context instance required by the create handler
       *    implementation
       * @exception Exception if an error occurs
       */
      void create( Object object, Context context )
          throws Exception;
  
      /**
       * Destroy stage handler.
       *
       * @param object the object that is being destroyed
       * @param context the context instance required by the handler
       *    implementation
       */
      void destroy( Object object, Context context );
     
  }
  
  
  

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