avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/handler AbstractComponentHandler.java ComponentFactory.java
Date Mon, 10 Feb 2003 15:35:47 GMT
bloritsch    2003/02/10 07:35:47

  Modified:    fortress/src/java/org/apache/avalon/fortress/impl/handler
                        AbstractComponentHandler.java ComponentFactory.java
  Log:
  update the instrumentable stuff.
  
  Revision  Changes    Path
  1.3       +19 -4     avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/handler/AbstractComponentHandler.java
  
  Index: AbstractComponentHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/handler/AbstractComponentHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractComponentHandler.java	7 Feb 2003 16:08:11 -0000	1.2
  +++ AbstractComponentHandler.java	10 Feb 2003 15:35:47 -0000	1.3
  @@ -59,6 +59,7 @@
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.excalibur.instrument.AbstractInstrumentable;
   import org.apache.excalibur.instrument.Instrumentable;
  +import org.apache.excalibur.instrument.CounterInstrument;
   import org.apache.excalibur.mpool.ObjectFactory;
   
   /**
  @@ -73,6 +74,9 @@
       extends AbstractInstrumentable
       implements Serviceable, Initializable, Disposable, ComponentHandler
   {
  +    private CounterInstrument m_request = new CounterInstrument("requests");
  +    private CounterInstrument m_release = new CounterInstrument("releases");
  +
       /**
        * The instance of the ComponentFactory that creates and disposes of the
        * Component
  @@ -132,6 +136,9 @@
               addChildInstrumentable( (Instrumentable)m_factory );
           }
   
  +        addInstrument( m_request );
  +        addInstrument( m_release );
  +
           setInstrumentableName( name );
       }
   
  @@ -201,6 +208,11 @@
               throw new IllegalStateException( message );
           }
   
  +        if ( m_request.isActive() )
  +        {
  +            m_request.increment();
  +        }
  +
           return doGet();
       }
   
  @@ -227,6 +239,11 @@
               throw new IllegalStateException( message );
           }
   
  +        if ( m_release.isActive() )
  +        {
  +            m_release.increment();
  +        }
  +
           doPut( component );
       }
   
  @@ -235,9 +252,7 @@
        *
        * @param component the component
        */
  -    protected void doPut( final Object component )
  -    {
  -    }
  +    protected void doPut( final Object component ) {}
   
       /**
        * Create a new component for handler.
  
  
  
  1.2       +6 -6      avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/handler/ComponentFactory.java
  
  Index: ComponentFactory.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/handler/ComponentFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ComponentFactory.java	27 Jan 2003 16:55:41 -0000	1.1
  +++ ComponentFactory.java	10 Feb 2003 15:35:47 -0000	1.2
  @@ -115,7 +115,7 @@
   
       /** Lifecycle extensions manager
        */
  -    private final org.apache.avalon.fortress.impl.LifecycleExtensionManager m_extManager;
  +    private final LifecycleExtensionManager m_extManager;
   
       /** InstrumentManager
        */
  @@ -157,11 +157,11 @@
      /**
       * Returns a new instance of a component and optionally applies a logging channel,
       * instrumentation, context, a component or service manager, configuration, parameters,
  -    * lifecycle extensions, initialization, and execution phases based on the interfaces

  +    * lifecycle extensions, initialization, and execution phases based on the interfaces
       * implemented by the component class.
  -    * 
  -    * @return the new instance 
  -    * @exception of 
  +    *
  +    * @return the new instance
  +    * @exception
       */
       public Object newInstance()
           throws Exception
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message