|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.excalibur.instrument.manager.impl.DefaultInstrumentManagerImpl
Field Summary |
Fields inherited from interface org.apache.excalibur.instrument.manager.DefaultInstrumentManager |
INSTRUMENT_SAMPLE_TYPE_COUNTER, INSTRUMENT_SAMPLE_TYPE_MAXIMUM, INSTRUMENT_SAMPLE_TYPE_MEAN, INSTRUMENT_SAMPLE_TYPE_MINIMUM, INSTRUMENT_TYPE_COUNTER, INSTRUMENT_TYPE_NONE, INSTRUMENT_TYPE_VALUE |
Fields inherited from interface org.apache.excalibur.instrument.InstrumentManager |
ROLE |
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable |
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY |
Constructor Summary | |
DefaultInstrumentManagerImpl()
Creates a new DefaultInstrumentManagerImpl. |
|
DefaultInstrumentManagerImpl(java.lang.String name)
Deprecated. Name should be set in the instrument configuration file. |
Method Summary | |
void |
configure(Configuration configuration)
Initializes the configured instrumentables. |
void |
dispose()
Disposes the InstrumentManager. |
Instrumentable[] |
getChildInstrumentables()
Any Object which implements Instrumentable can also make use of other Instrumentable child objects. |
java.lang.String |
getDescription()
Returns the description of this DefaultInstrumentManager. |
InstrumentableDescriptor |
getInstrumentableDescriptor(java.lang.String instrumentableName)
Returns a InstrumentableDescriptor based on its name or the name of any of its children. |
InstrumentableDescriptor[] |
getInstrumentableDescriptors()
Returns an array of Descriptors for the Instrumentables managed by this DefaultInstrumentManager. |
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. |
int |
getLeaseSampleCount()
Returns the current number of leased samples. |
long |
getMaxLeasedSampleLease()
Returns the maximum number of milliseconds that a lease will be granted for. |
int |
getMaxLeasedSamples()
Returns the maximum number of leased samples that will be approved. |
int |
getMaxLeasedSampleSize()
Returns the maximum size of a leased sample. |
java.lang.String |
getName()
Returns the name used to identify this DefaultInstrumentManager. |
int |
getStateVersion()
Returns the stateVersion of the DefaultInstrumeManager. |
void |
initialize()
Initializes the InstrumentManager. |
void |
invokeGarbageCollection()
Invokes garbage collection. |
void |
loadStateFromConfiguration(Configuration state)
Loads the Instrument Manager state from the specified Configuration. |
void |
loadStateFromFile(java.io.File stateFile)
Loads the Instrument Manager state from the specified file. |
void |
loadStateFromStream(java.io.InputStream is)
Loads the Instrument Manager state from the specified stream. |
InstrumentableDescriptor |
locateInstrumentableDescriptor(java.lang.String instrumentableName)
Searches the entire instrument tree for an instrumentable with the given name. |
InstrumentDescriptor |
locateInstrumentDescriptor(java.lang.String instrumentName)
Searches the entire instrument tree for an instrument with the given name. |
InstrumentSampleDescriptor |
locateInstrumentSampleDescriptor(java.lang.String sampleName)
Searches the entire instrument tree for an instrument sample with the given name. |
void |
registerInstrumentable(Instrumentable instrumentable,
java.lang.String instrumentableName)
Instrumentable to be registered with the instrument manager. |
void |
registerNameTranslation(java.lang.String source,
java.lang.String target)
Registers a name translation that will be applied to all named based lookups of instrumentables, instruments, and samples. |
void |
run()
|
void |
saveStateToFile(java.io.File stateFile)
Saves the Instrument Manager's state to the specified file. |
void |
saveStateToStream(java.io.OutputStream os)
Saves the Instrument Manager's state to the specified output stream. |
void |
setInstrumentableName(java.lang.String name)
Sets the name for the Instrumentable. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultInstrumentManagerImpl(java.lang.String name)
name
- The name used to identify this InstrumentManager. Should not
contain any spaces or periods.public DefaultInstrumentManagerImpl()
Method Detail |
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
configuration
- InstrumentManager configuration.
ConfigurationException
- If there are any configuration problems.public void initialize() throws java.lang.Exception
initialize
in interface Initializable
java.lang.Exception
- If there were any problems initializing the object.public void dispose()
dispose
in interface Disposable
public void registerInstrumentable(Instrumentable instrumentable, java.lang.String instrumentableName) throws java.lang.Exception
registerInstrumentable
in interface InstrumentManager
instrumentable
- Instrumentable to register with the InstrumentManager.instrumentableName
- The name to use when registering the Instrumentable.
java.lang.Exception
- If there were any problems registering the Instrumentable.public java.lang.String getName()
getName
in interface DefaultInstrumentManager
public java.lang.String getDescription()
getDescription
in interface DefaultInstrumentManager
public void registerNameTranslation(java.lang.String source, java.lang.String target) throws java.lang.IllegalArgumentException
General operation of the instrument manager will not be affected as collection on sample data is always done using direct object references.
Translations can be registered for exact name matches, or for the bases of names. Any translation which ends in a '.' will imply a translation to any name beginning with that name base. If the source ends with a '.' then the target must as well.
source
- The source name or name base of the translation.target
- The target name or name base of the translation.
java.lang.IllegalArgumentException
- If the one but not both of the source
and target parameters end in '.'.public InstrumentableDescriptor getInstrumentableDescriptor(java.lang.String instrumentableName) throws NoSuchInstrumentableException
getInstrumentableDescriptor
in interface DefaultInstrumentManager
instrumentableName
- Name of the Instrumentable being requested.
NoSuchInstrumentableException
- If the specified Instrumentable
does not exist.public InstrumentableDescriptor[] getInstrumentableDescriptors()
getInstrumentableDescriptors
in interface DefaultInstrumentManager
public InstrumentableDescriptor locateInstrumentableDescriptor(java.lang.String instrumentableName) throws NoSuchInstrumentableException
locateInstrumentableDescriptor
in interface DefaultInstrumentManager
instrumentableName
- Name of the Instrumentable being requested.
NoSuchInstrumentableException
- If the specified Instrumentable
does not exist.public InstrumentDescriptor locateInstrumentDescriptor(java.lang.String instrumentName) throws NoSuchInstrumentException
locateInstrumentDescriptor
in interface DefaultInstrumentManager
instrumentName
- Name of the Instrument being requested.
NoSuchInstrumentException
- If the specified Instrument does
not exist.public InstrumentSampleDescriptor locateInstrumentSampleDescriptor(java.lang.String sampleName) throws NoSuchInstrumentSampleException
locateInstrumentSampleDescriptor
in interface DefaultInstrumentManager
sampleName
- Name of the Instrument Sample being requested.
NoSuchInstrumentSampleException
- If the specified Instrument
Sample does not exist.public int getStateVersion()
Clients can use this value to tell whether or not anything has changed without having to do an exhaustive comparison.
getStateVersion
in interface DefaultInstrumentManager
public void invokeGarbageCollection()
invokeGarbageCollection
in interface DefaultInstrumentManager
public int getLeaseSampleCount()
getLeaseSampleCount
in interface DefaultInstrumentManager
public int getMaxLeasedSamples()
getMaxLeasedSamples
in interface DefaultInstrumentManager
public int getMaxLeasedSampleSize()
getMaxLeasedSampleSize
in interface DefaultInstrumentManager
public long getMaxLeasedSampleLease()
getMaxLeasedSampleLease
in interface DefaultInstrumentManager
public void setInstrumentableName(java.lang.String name)
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.
setInstrumentableName
in interface Instrumentable
name
- The name used to identify a Instrumentable.public java.lang.String getInstrumentableName()
getInstrumentableName
in interface Instrumentable
public Instrument[] getInstruments()
getInstruments
in interface Instrumentable
public Instrumentable[] getChildInstrumentables()
getChildInstrumentables
in interface Instrumentable
public void run()
run
in interface java.lang.Runnable
public void loadStateFromFile(java.io.File stateFile) throws java.lang.Exception
stateFile
- File to read the instrument manager's state from.
java.lang.Exception
- if there are any problems loading the state.public void loadStateFromStream(java.io.InputStream is) throws java.lang.Exception
is
- Stream to read the instrument manager's state from.
java.lang.Exception
- if there are any problems loading the state.public void loadStateFromConfiguration(Configuration state) throws ConfigurationException
state
- Configuration object to load the state from.
ConfigurationException
- If there were any problems loading the
state.public void saveStateToFile(java.io.File stateFile) throws java.lang.Exception
stateFile
- File to write the Instrument Manager's state to.
java.lang.Exception
- if there are any problems saving the state.public void saveStateToStream(java.io.OutputStream os) throws java.lang.Exception
os
- Stream to write the Instrument Manager's state to.
java.lang.Exception
- if there are any problems saving the state.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |