avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject cvs commit: avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/punit PUnitResourceProvider.java
Date Mon, 17 Mar 2003 03:42:20 GMT
proyal      2003/03/16 19:42:20

  Modified:    src/java/org/apache/avalon/phoenix/components/application
                        ListenerResourceProvider.java
                        BlockResourceProvider.java
               src/java/org/apache/avalon/phoenix/containerkit/demo
                        SimpleResourceProvider.java
               src/java/org/apache/avalon/phoenix/tools/punit
                        PUnitResourceProvider.java
  Log:
  Implementations of resource providers
  
  Revision  Changes    Path
  1.9       +29 -1     avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/ListenerResourceProvider.java
  
  Index: ListenerResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/ListenerResourceProvider.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ListenerResourceProvider.java	1 Mar 2003 08:39:14 -0000	1.8
  +++ ListenerResourceProvider.java	17 Mar 2003 03:42:20 -0000	1.9
  @@ -21,6 +21,7 @@
   import org.apache.avalon.phoenix.containerkit.metadata.ComponentMetaData;
   import org.apache.avalon.phoenix.containerkit.profile.ComponentProfile;
   import org.apache.avalon.phoenix.interfaces.ApplicationContext;
  +import org.apache.excalibur.instrument.InstrumentManager;
   
   /**
    * The accessor used to access resources for a particular
  @@ -81,6 +82,33 @@
           final ComponentMetaData metaData = getMetaData( entry );
           final String name = metaData.getName();
           return m_context.getLogger( name );
  +    }
  +
  +    /**
  +     * Create a new InstrumentMaanger object for component.
  +     *
  +     * @param entry the entry
  +     * @return a new InstrumentManager object for component
  +     * @throws Exception if unable to create resource
  +     */
  +    public InstrumentManager createInstrumentManager( Object entry )
  +        throws Exception
  +    {
  +        return m_context.getInstrumentManager();
  +    }
  +
  +    /**
  +     * Create a name for this components instrumentables.
  +     *
  +     * @param entry the entry
  +     * @return the String to use as the instrumentable name
  +     * @throws Exception if unable to create resource
  +     */
  +    public String createInstrumentableName( Object entry )
  +        throws Exception
  +    {
  +        final String name = getMetaData( entry ).getName();
  +        return m_context.getInstrumentableName( name );
       }
   
       public Context createContext( final Object entry )
  
  
  
  1.18      +30 -1     avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockResourceProvider.java
  
  Index: BlockResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockResourceProvider.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- BlockResourceProvider.java	1 Mar 2003 08:39:14 -0000	1.17
  +++ BlockResourceProvider.java	17 Mar 2003 03:42:20 -0000	1.18
  @@ -32,6 +32,7 @@
   import org.apache.avalon.phoenix.containerkit.profile.ComponentProfile;
   import org.apache.avalon.phoenix.interfaces.Application;
   import org.apache.avalon.phoenix.interfaces.ApplicationContext;
  +import org.apache.excalibur.instrument.InstrumentManager;
   
   /**
    * The accessor used to access resources for a particular
  @@ -105,6 +106,34 @@
           final ComponentProfile profile = getProfileFor( entry );
           final String name = profile.getMetaData().getName();
           return m_context.getLogger( name );
  +    }
  +
  +    /**
  +     * Create a new InstrumentMaanger object for component.
  +     *
  +     * @param entry the entry
  +     * @return a new InstrumentManager object for component
  +     * @throws Exception if unable to create resource
  +     */
  +    public InstrumentManager createInstrumentManager( Object entry )
  +        throws Exception
  +    {
  +        return m_context.getInstrumentManager();
  +    }
  +
  +    /**
  +     * Create a name for this components instrumentables.
  +     *
  +     * @param entry the entry
  +     * @return the String to use as the instrumentable name
  +     * @throws Exception if unable to create resource
  +     */
  +    public String createInstrumentableName( Object entry )
  +        throws Exception
  +    {
  +        final ComponentProfile profile = getProfileFor( entry );
  +        final String name = profile.getMetaData().getName();
  +        return m_context.getInstrumentableName( name );
       }
   
       /**
  
  
  
  1.2       +16 -1     avalon-phoenix/src/java/org/apache/avalon/phoenix/containerkit/demo/SimpleResourceProvider.java
  
  Index: SimpleResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/containerkit/demo/SimpleResourceProvider.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleResourceProvider.java	18 Jan 2003 16:43:43 -0000	1.1
  +++ SimpleResourceProvider.java	17 Mar 2003 03:42:20 -0000	1.2
  @@ -13,6 +13,8 @@
   import org.apache.avalon.phoenix.containerkit.kernel.ComponentEntry;
   import org.apache.avalon.phoenix.containerkit.lifecycle.impl.AbstractResourceProvider;
   import org.apache.avalon.phoenix.containerkit.metadata.ComponentMetaData;
  +import org.apache.excalibur.instrument.InstrumentManager;
  +import org.apache.excalibur.instrument.manager.NoopInstrumentManager;
   
   /**
    * @author <a href="mailto:peter at apache.org">Peter Donald</a>
  @@ -53,5 +55,18 @@
       {
           final ComponentMetaData component = getMetaData( entry );
           return getLogger().getChildLogger( component.getName() );
  +    }
  +
  +    public InstrumentManager createInstrumentManager( Object entry )
  +        throws Exception
  +    {
  +        return new NoopInstrumentManager();
  +    }
  +
  +    public String createInstrumentableName( Object entry )
  +        throws Exception
  +    {
  +        final ComponentMetaData component = getMetaData( entry );
  +        return component.getName();
       }
   }
  
  
  
  1.10      +28 -0     avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/punit/PUnitResourceProvider.java
  
  Index: PUnitResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/punit/PUnitResourceProvider.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PUnitResourceProvider.java	22 Feb 2003 04:03:30 -0000	1.9
  +++ PUnitResourceProvider.java	17 Mar 2003 03:42:20 -0000	1.10
  @@ -15,6 +15,8 @@
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.phoenix.containerkit.lifecycle.ResourceProvider;
  +import org.apache.excalibur.instrument.manager.NoopInstrumentManager;
  +import org.apache.excalibur.instrument.InstrumentManager;
   
   /**
    * PUnitResourceProvider
  @@ -64,6 +66,32 @@
       public Logger createLogger( final Object object ) throws Exception
       {
           return m_logger;
  +    }
  +
  +    /**
  +     * Create a new InstrumentMaanger object for component.
  +     *
  +     * @param entry the entry
  +     * @return a new InstrumentManager object for component
  +     * @throws Exception if unable to create resource
  +     */
  +    public InstrumentManager createInstrumentManager( Object entry )
  +        throws Exception
  +    {
  +        return new NoopInstrumentManager();
  +    }
  +
  +    /**
  +     * Create a name for this components instrumentables.
  +     *
  +     * @param entry the entry
  +     * @return the String to use as the instrumentable name
  +     * @throws Exception if unable to create resource
  +     */
  +    public String createInstrumentableName( Object entry )
  +        throws Exception
  +    {
  +        return "punit";
       }
   
       /**
  
  
  

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


Mime
View raw message