avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/instrument/src/java/org/apache/avalon/excalibur/instrument AbstractLogEnabledInstrumentable.java AbstractInstrumentable.java
Date Mon, 22 Apr 2002 03:45:49 GMT
leif        02/04/21 20:45:49

  Modified:    instrument ant.properties.sample build.xml
                        default.properties
               instrument/src/java/org/apache/avalon/excalibur/instrument
                        AbstractInstrumentable.java
  Added:       instrument/src/java/org/apache/avalon/excalibur/instrument
                        AbstractLogEnabledInstrumentable.java
  Log:
  Add AbstractLogEnabledInstrumentable using an optional dependency on framework.
  
  Revision  Changes    Path
  1.3       +6 -1      jakarta-avalon-excalibur/instrument/ant.properties.sample
  
  Index: ant.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/ant.properties.sample,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ant.properties.sample	8 Apr 2002 10:32:10 -0000	1.2
  +++ ant.properties.sample	22 Apr 2002 03:45:49 -0000	1.3
  @@ -10,7 +10,7 @@
   # It is overridden by ../ant.properties and ~/build.properties
   # It overrides all default.properties files and ~/.ant.properties
   #
  -# $Id: ant.properties.sample,v 1.2 2002/04/08 10:32:10 jefft Exp $
  +# $Id: ant.properties.sample,v 1.3 2002/04/22 03:45:49 leif Exp $
   # -----------------------------------------------------------------------------
   
   # ----- Compile Control Flags -----
  @@ -30,6 +30,11 @@
   # --------------------------------------------------
   #                OPTIONAL LIBRARIES
   # --------------------------------------------------
  +
  +# ----- Avalon Framework, version 4.1 or later -----
  +avalon-framework.home=${basedir}/../../jakarta-avalon
  +avalon-framework.lib=${avalon-framework.home}/build/lib
  +avalon-framework.jar=${avalon-framework.lib}/avalon-framework.jar
   
   # ----- JUnit Unit Test Suite, version 3.7 or later. -----
   #  Not needed if junit.jar is in $ANT_HOME/lib 
  
  
  
  1.19      +13 -1     jakarta-avalon-excalibur/instrument/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/build.xml,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- build.xml	16 Apr 2002 12:00:41 -0000	1.18
  +++ build.xml	22 Apr 2002 03:45:49 -0000	1.19
  @@ -14,6 +14,9 @@
           <pathelement path="${java.class.path}"/>
           <pathelement location="${build.classes}"/>
           <pathelement location="${checkstyle.jar}"/>
  +        
  +        <!-- Optional jars -->
  +        <pathelement location="${avalon-framework.jar}"/>
       </path>
   
       <path id="tools.class.path">
  @@ -33,6 +36,13 @@
       <target name="main" depends="jar" description="Build the project"/>
       <target name="rebuild" depends="clean,main" description="Rebuild the project"/>
   
  +    <!-- Checks the environment for existing resources -->
  +    <target name="check-environment">
  +        <available property="framework.present" classname="org.apache.avalon.framework.logger.AbstractLogEnabled">
  +            <classpath refid="project.class.path"/>
  +        </available>
  +    </target>
  +    
       <target name="dependencies" description="Check dependencies" unless="skip.dependencies">
           <ant antfile="${depchecker.prefix}/depchecker.xml" target="checkCommon"/>
       </target>
  @@ -46,7 +56,7 @@
   
   
       <!-- Compiles the source code -->
  -    <target name="compile" depends="dependencies" description="Compiles the source code">
  +    <target name="compile" depends="dependencies, check-environment" description="Compiles
the source code">
   
           <mkdir dir="${build.classes}"/>
   
  @@ -59,6 +69,8 @@
               target="1.2">
               <classpath refid="project.class.path" />
               <include name="**/*.java"/>
  +            <exclude name="org/apache/avalon/excalibur/instrument/AbstractLogEnabledInstrumentable.java"
  +                     unless="framework.present"/>
           </javac>
   
           <!-- copy resources to same location as .class files -->
  
  
  
  1.6       +12 -0     jakarta-avalon-excalibur/instrument/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/default.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- default.properties	16 Apr 2002 12:00:41 -0000	1.5
  +++ default.properties	22 Apr 2002 03:45:49 -0000	1.6
  @@ -15,7 +15,19 @@
   # --------------------------------------------------
   #                REQUIRED LIBRARIES
   # --------------------------------------------------
  +# None
  +
   # --------------------------------------------------
  +#                OPTIONAL LIBRARIES
  +# --------------------------------------------------
  +
  +# ----- Avalon Framework, version 4.1 or later -----
  +avalon-framework.home=${basedir}/../../jakarta-avalon
  +avalon-framework.lib=${avalon-framework.home}/build/lib
  +avalon-framework.jar=${avalon-framework.lib}/avalon-framework.jar
  +
  +# --------------------------------------------------
  +
   
   #  Settings used to configure compile environment
   build.debug = on
  
  
  
  1.2       +2 -1      jakarta-avalon-excalibur/instrument/src/java/org/apache/avalon/excalibur/instrument/AbstractInstrumentable.java
  
  Index: AbstractInstrumentable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/instrument/src/java/org/apache/avalon/excalibur/instrument/AbstractInstrumentable.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractInstrumentable.java	18 Apr 2002 15:26:51 -0000	1.1
  +++ AbstractInstrumentable.java	22 Apr 2002 03:45:49 -0000	1.2
  @@ -14,7 +14,8 @@
    *
    * @author <a href="mailto:ryan.shaw@stanfordalumni.org">Ryan Shaw</a>
    */
  -public abstract class AbstractInstrumentable 
  +public abstract class AbstractInstrumentable
  +    implements Instrumentable
   {
       /** Name of the instrumentable. */
       private String m_instrumentableName; 
  
  
  
  1.1                  jakarta-avalon-excalibur/instrument/src/java/org/apache/avalon/excalibur/instrument/AbstractLogEnabledInstrumentable.java
  
  Index: AbstractLogEnabledInstrumentable.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.avalon.excalibur.instrument;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  
  /**
   * Utility class to ease the construction of components that can be instrumented
   *  but must also implement LogEnabled.
   * Subclasses must override either <code>getChildInstrumentables</code> or
   * <code>getInstruments</code>, or both, to be of any use.
   *
   * @author <a href="mailto:ryan.shaw@stanfordalumni.org">Ryan Shaw</a>
   * @author <a href="mailto:leif@tanukisoftware.com">Leif Mortenson</a>
   */
  public abstract class AbstractLogEnabledInstrumentable
      extends AbstractLogEnabled
      implements Instrumentable
  {
      /** Name of the instrumentable. */
      private String m_instrumentableName; 
      
      /**
       * Gets the name of the Instrumentable.
       *
       * @return The name used to identify a Instrumentable.
       */
      public String getInstrumentableName() 
      {
          return m_instrumentableName;
      }
  
      /**
       * Sets the name for the Instrumentable.  The Instrumentable Name is used
       *  to uniquely identify the Instrumentable during the configuration of
       *  the InstrumentManager and to gain access to an InstrumentableDescriptor
       *  through the InstrumentManager.  The value should be a string which does
       *  not contain spaces or periods.
       * <p>
       * This value may be set by a parent Instrumentable, or by the
       *  InstrumentManager using the value of the 'instrumentable' attribute in
       *  the configuration of the component.
       *
       * @param name The name used to identify a Instrumentable.
       */
      public void setInstrumentableName(String name) 
      {
          m_instrumentableName = name;
      }
      
      /**
       * Any Object which implements Instrumentable can also make use of other
       *  Instrumentable child objects.  This method is used to tell the
       *  InstrumentManager about them.
       *
       * @return An array of child Instrumentables.  This method should never
       *         return null.  If there are no child Instrumentables, then
       *         EMPTY_INSTRUMENTABLE_ARRAY can be returned.
       */
      public Instrumentable[] getChildInstrumentables() 
      {
          return Instrumentable.EMPTY_INSTRUMENTABLE_ARRAY;
      }
      
      /**
       * Obtain a reference to all the Instruments that the Instrumentable object
       *  wishes to expose.  All sampling is done directly through the
       *  Instruments as opposed to the Instrumentable interface.
       *
       * @return An array of the Instruments available for profiling.  Should
       *         never be null.  If there are no Instruments, then
       *         EMPTY_INSTRUMENT_ARRAY can be returned.  This should never be
       *         the case though unless there are child Instrumentables with
       *         Instruments.
       */
      public Instrument[] getInstruments() 
      {
          return Instrumentable.EMPTY_INSTRUMENT_ARRAY;
      }
  }
  
  
  

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


Mime
View raw message