org.apache.excalibur.instrument
Interface Instrumentable

All Known Implementing Classes:
AbstractComponentManagerServlet, AbstractDualLogEnabledInstrumentable, AbstractInstrumentable, AbstractLogEnabledInstrumentable, AbstractObjectFactory, AbstractServiceManagerServlet, DefaultExampleInstrumentable, DefaultInstrumentManagerImpl, ExcaliburComponentManager, ExcaliburComponentSelector, InstrumentedResourceLimitingPool, InstrumentedResourceLimitingThreadPool, MRUMemoryStore

public interface Instrumentable

The Instrumentable interface is to mark objects that can be sampled by an InstrumentManager. The getInstruments method may or may not be called depending on whether or not the ComponentLocator used to create the Component supports Instrumentables. In most cases, an instrumentable object should always create its internal Instruments and make use of them as if instrument data were being collected. The Instruments are optimized so as not to reduce performance when they are not being used.

Since:
4.1
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:28 $
Author:
Avalon Development Team

Field Summary
static Instrument[] EMPTY_INSTRUMENT_ARRAY
          Empty Instrument array for use in hierarchical Instrumentable systems.
static Instrumentable[] EMPTY_INSTRUMENTABLE_ARRAY
          Empty Instrumentable array for use in hierarchical Instrumentable systems.
 
Method Summary
 Instrumentable[] getChildInstrumentables()
          Any Object which implements Instrumentable can also make use of other Instrumentable child objects.
 java.lang.String getInstrumentableName()
          Gets the name of the Instrumentable.
 Instrument[] getInstruments()
          Obtain a reference to all the Instruments that the Instrumentable object wishes to expose.
 void setInstrumentableName(java.lang.String name)
          Sets the name for the Instrumentable.
 

Field Detail

EMPTY_INSTRUMENT_ARRAY

public static final Instrument[] EMPTY_INSTRUMENT_ARRAY
Empty Instrument array for use in hierarchical Instrumentable systems.


EMPTY_INSTRUMENTABLE_ARRAY

public static final Instrumentable[] EMPTY_INSTRUMENTABLE_ARRAY
Empty Instrumentable array for use in hierarchical Instrumentable systems.

Method Detail

setInstrumentableName

public void setInstrumentableName(java.lang.String 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.

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.

Parameters:
name - The name used to identify a Instrumentable.

getInstrumentableName

public java.lang.String getInstrumentableName()
Gets the name of the Instrumentable.

Returns:
The name used to identify a Instrumentable.

getInstruments

public Instrument[] getInstruments()
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.

Returns:
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.

getChildInstrumentables

public Instrumentable[] getChildInstrumentables()
Any Object which implements Instrumentable can also make use of other Instrumentable child objects. This method is used to tell the InstrumentManager about them.

Returns:
An array of child Instrumentables. This method should never return null. If there are no child Instrumentables, then EMPTY_INSTRUMENTABLE_ARRAY can be returned.


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.