avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Mortenson <l...@tanukisoftware.com>
Subject Re: AbstractInstrumentable extends AbstractLoggable
Date Thu, 18 Apr 2002 15:34:56 GMT
I committed the original patch. I would rather not have Instrument have 
any dependencies.
Maybe having an AbstractLogEnabledInstrumentable in the logger subproject?
Not too unmovable on adding the dependency, but it is nice to have it 
independent.
If the AbstractLogEnabledInstrumentable class was in addition to the 
AbstractInstrumentable
class, then the dependency would only be at compile time and so users 
who were not using
framework could still use the Instrumentable classes.

Thoughts?

Leif

Ryan Shaw wrote:

>Okay, attached is a version of AbstractInstrumentable that extends 
>AbstractLoggable, and a patch for the instrument package build that
>is neccessary for the new dependency.
>
>>This would add a new dependency from the instrument package 
>>to framework, though. Is that a problem for anybody?
>>
>>Ryan Shaw wrote:
>>
>>>I have no problem if whoever checks it in wants to add that.
>>>
>>>Peter Royal wrote:
>>>
>>>>On Wednesday 17 April 2002 09:37 pm, Ryan Shaw wrote:
>>>>
>>>>>Attached is a utility class to ease the implementation
>>>>>of Instrumentables, in the tradition of AbstractLogEnabled.
>>>>>
>>>>It would be nice if it extended AbstractLogEnabled, so you don't have to 
>>>>choose :)
>>>>-pete
>>>>
>>>>-- 
>>>>peter royal -> proyal@managingpartners.com
>>>>
>>>>--
>>>>To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
>>>>For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>
>>>>
>>>>
>>>--
>>>To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
>>>For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>
>>>
>>>
>>--
>>To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>
>>
>>
>>
>>------------------------------------------------------------------------
>>
>>/*
>> * 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.
>> * 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>
>> */
>>public abstract class AbstractInstrumentable extends AbstractLogEnabled
>>{
>>    private String m_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;
>>    }
>>
>>    /**
>>     * Gets the name of the Instrumentable.
>>     *
>>     * @return The name used to identify a Instrumentable.
>>     */
>>    public String getInstrumentableName() 
>>    {
>>        return m_name;
>>    }
>>
>>    /**
>>     * 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_name = name;
>>    }
>>}
>>
>>
>>------------------------------------------------------------------------
>>
>>Index: build.xml
>>===================================================================
>>RCS file: /home/cvspublic/jakarta-avalon-excalibur/instrument/build.xml,v
>>retrieving revision 1.12
>>diff -u -r1.12 build.xml
>>--- build.xml	8 Apr 2002 12:15:41 -0000	1.12
>>+++ build.xml	18 Apr 2002 02:07:58 -0000
>>@@ -13,6 +13,7 @@
>>     <path id="project.class.path">
>>         <pathelement path="${java.class.path}"/>
>>         <pathelement location="${build.classes}"/>
>>+        <pathelement location="${avalon-framework.jar}"/>
>>         <pathelement location="${junit.jar}"/>
>>         <pathelement location="${checkstyle.jar}"/>
>>     </path>
>>Index: default.properties
>>===================================================================
>>RCS file: /home/cvspublic/jakarta-avalon-excalibur/instrument/default.properties,v
>>retrieving revision 1.3
>>diff -u -r1.3 default.properties
>>--- default.properties	8 Apr 2002 10:32:10 -0000	1.3
>>+++ default.properties	18 Apr 2002 02:07:58 -0000
>>@@ -13,6 +13,12 @@
>> # --------------------------------------------------
>> #                REQUIRED 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
>>
>>
>>------------------------------------------------------------------------
>>
>>--
>>To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>
>>
>> AbstractInstrumentable.java
>>
>> Content-Type:
>>
>> text/x-java
>> Content-Encoding:
>>
>> base64
>>
>>
>> ------------------------------------------------------------------------
>> instrument-build.patch
>>
>> Content-Type:
>>
>> text/plain
>> Content-Encoding:
>>
>> base64
>>
>>
>> ------------------------------------------------------------------------
>> ??? 1.4
>>
>> Content-Type:
>>
>> text/plain
>>
>>



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


Mime
View raw message