|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.excalibur.instrument.manager.DefaultInstrumentManager
| Field Summary | |
static java.lang.String |
INSTRUMENT_ACTIVE_THREAD_COUNT |
static java.lang.String |
INSTRUMENT_FREE_MEMORY |
static java.lang.String |
INSTRUMENT_MEMORY |
static java.lang.String |
INSTRUMENT_TOTAL_MEMORY |
private ValueInstrument |
m_activeThreadCountInstrumentInstrument used to profile the active thread count of the JVM. |
private Configuration |
m_configurationConfiguration for the InstrumentManager |
private java.util.ArrayList |
m_connectorsList of configured connectors. |
private java.lang.String |
m_descriptionThe description of this InstrumentManager. |
private ValueInstrument |
m_freeMemoryInstrumentInstrument used to profile the free memory. |
private InstrumentableDescriptorLocal[] |
m_instrumentableDescriptorArrayOptimized array of the InstrumentableDescriptorLocals. |
private java.lang.String |
m_instrumentableNameInstrumentable Name assigned to this Instrumentable |
private java.util.HashMap |
m_instrumentableProxiesHashMap of all of the registered InstrumentableProxies by their keys. |
private InstrumentableProxy[] |
m_instrumentableProxyArrayOptimized array of the InstrumentableProxies. |
private long |
m_lastStateSaveLast time that the state was saved. |
private InstrumentSample[] |
m_leasedInstrumentSampleArrayOptimized array of the leased InstrumentSamples. |
private java.util.ArrayList |
m_leasedInstrumentSamplesList of leased InstrumentSamples. |
private ValueInstrument |
m_memoryInstrumentInstrument used to profile the in use memory. |
private java.lang.String |
m_nameThe name used to identify this InstrumentManager. |
private java.lang.Thread |
m_runnerThread used to keep the instruments published by the InstrumentManager up to date. |
private java.lang.Object |
m_semaphoreSemaphore for actions which must be synchronized |
private java.io.File |
m_stateFileState file. |
private long |
m_stateIntervalSave state interval. |
private int |
m_stateVersionState Version. |
private ValueInstrument |
m_totalMemoryInstrumentInstrument used to profile the total memory. |
| Fields inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|
| 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 | |
DefaultInstrumentManager()Creates a new DefaultInstrumentManager. |
|
DefaultInstrumentManager(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 InstrumentManager. |
InstrumentableDescriptorLocal |
getInstrumentableDescriptor(java.lang.String instrumentableName)Returns an InstrumentableDescriptorLocal based on its name or the name of any of its children. |
InstrumentableDescriptorLocal[] |
getInstrumentableDescriptors()Returns an array of Descriptors for the Instrumentables managed by this InstrumentManager. |
java.lang.String |
getInstrumentableName()Gets the name of the Instrumentable. |
private InstrumentableProxy |
getInstrumentableProxy(java.lang.String instrumentableName)Returns a InstrumentableDescriptor based on its name or the name of any of its children. |
Instrument[] |
getInstruments()Obtain a reference to all the Instruments that the Instrumentable object wishes to expose. |
java.lang.String |
getName()Returns the name used to identify this InstrumentManager. |
(package private) int |
getStateVersion()Returns the stateVersion of the instrument manager. |
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. |
private InstrumentableProxy |
locateDeepestInstrumentableProxy(java.lang.String instrumentableName)Given the name of an instrumentable proxy, locate the deepest child instrumentable given the name. |
InstrumentableDescriptorLocal |
locateInstrumentableDescriptor(java.lang.String instrumentableName)Searches the entire instrument tree an instrumentable with the given name. |
InstrumentDescriptorLocal |
locateInstrumentDescriptor(java.lang.String instrumentName)Searches the entire instrument tree an instrument with the given name. |
InstrumentSampleDescriptorLocal |
locateInstrumentSampleDescriptor(java.lang.String sampleName)Searches the entire instrument tree an instrument sample with the given name. |
private void |
memoryInstruments()Updates the Memory based Profile Points published by the InstrumentManager. |
private void |
registerDummyInstrumentableInner(Instrumentable instrumentable, InstrumentableProxy instrumentableProxy, java.lang.String instrumentableName, java.lang.String childName)Called as a place holder to handle the registration of instrumentables that do not really exist. |
void |
registerInstrumentable(Instrumentable instrumentable, java.lang.String instrumentableName)Instrumentable to be registered with the instrument manager. |
private void |
registerInstrumentableInner(Instrumentable instrumentable, InstrumentableProxy instrumentableProxy, java.lang.String instrumentableName)Examines a instrumentable and Registers all of its child Instrumentables and Instruments. |
(package private) void |
registerLeasedInstrumentSample(InstrumentSample instrumentSample)Registers an InstrumentSample which has been leased so that the Instrument Manager can efficiently purge it when it has expired. |
void |
run() |
private void |
saveState()Saves the state to the current state file if configured. |
Configuration |
saveStateToConfiguration()Returns the Instrument Manager's state as a Configuration object. |
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. |
protected void |
stateChanged()Called whenever the state of the instrument manager is changed. |
private void |
testInstrumentSampleLeases()Handles the maintenance of all Instrument Samples which have been leased by a client. |
private void |
threadInstruments()Updates the Thread based Profile Points published by the InstrumentManager. |
private InstrumentableDescriptorLocal[] |
updateInstrumentableDescriptorArray()Updates the cached array of InstrumentableDescriptorLocals taking synchronization into account. |
private InstrumentableProxy[] |
updateInstrumentableProxyArray()Updates the cached array of InstrumentableProxies taking synchronization into account. |
| 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 |
| Field Detail |
public static final java.lang.String INSTRUMENT_TOTAL_MEMORY
public static final java.lang.String INSTRUMENT_FREE_MEMORY
public static final java.lang.String INSTRUMENT_MEMORY
public static final java.lang.String INSTRUMENT_ACTIVE_THREAD_COUNT
private java.lang.String m_name
private java.lang.String m_description
private Configuration m_configuration
private java.util.ArrayList m_connectors
private java.io.File m_stateFile
private long m_stateInterval
private long m_lastStateSave
private java.lang.Object m_semaphore
private java.util.HashMap m_instrumentableProxies
private InstrumentableProxy[] m_instrumentableProxyArray
private InstrumentableDescriptorLocal[] m_instrumentableDescriptorArray
private java.util.ArrayList m_leasedInstrumentSamples
private InstrumentSample[] m_leasedInstrumentSampleArray
private java.lang.Thread m_runner
private java.lang.String m_instrumentableName
private ValueInstrument m_totalMemoryInstrument
private ValueInstrument m_freeMemoryInstrument
private ValueInstrument m_memoryInstrument
private ValueInstrument m_activeThreadCountInstrument
private int m_stateVersion
| Constructor Detail |
public DefaultInstrumentManager(java.lang.String name)
name - The name used to identify this InstrumentManager. Should not contain any spaces or periods.public DefaultInstrumentManager()
| Method Detail |
public void configure(Configuration configuration)
throws ConfigurationException
configure in interface Configurableconfiguration - InstrumentManager configuration.ConfigurationException - If there are any configuration problems.
public void initialize()
throws java.lang.Exception
initialize in interface Initializablejava.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 InstrumentManagerinstrumentable - 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()
public java.lang.String getDescription()
public InstrumentableDescriptorLocal getInstrumentableDescriptor(java.lang.String instrumentableName)
throws NoSuchInstrumentableException
instrumentableName - Name of the Instrumentable being requested.NoSuchInstrumentableException - If the specified Instrumentable does not exist.public InstrumentableDescriptorLocal[] getInstrumentableDescriptors()
public InstrumentableDescriptorLocal locateInstrumentableDescriptor(java.lang.String instrumentableName)
throws NoSuchInstrumentableException
instrumentableName - Name of the Instrumentable being requested.NoSuchInstrumentableException - If the specified Instrumentable does not exist.
public InstrumentDescriptorLocal locateInstrumentDescriptor(java.lang.String instrumentName)
throws NoSuchInstrumentException
instrumentName - Name of the Instrument being requested.NoSuchInstrumentException - If the specified Instrument does not exist.
public InstrumentSampleDescriptorLocal locateInstrumentSampleDescriptor(java.lang.String sampleName)
throws NoSuchInstrumentSampleException
sampleName - Name of the Instrument Sample being requested.NoSuchInstrumentSampleException - If the specified Instrument Sample does not exist.int getStateVersion()
public void invokeGarbageCollection()
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.public Configuration saveStateToConfiguration()
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 Instrumentablename - The name used to identify a Instrumentable.public java.lang.String getInstrumentableName()
getInstrumentableName in interface Instrumentablepublic Instrument[] getInstruments()
getInstruments in interface Instrumentablepublic Instrumentable[] getChildInstrumentables()
getChildInstrumentables in interface Instrumentablepublic void run()
run in interface java.lang.Runnableprivate void saveState()
private InstrumentableProxy getInstrumentableProxy(java.lang.String instrumentableName)
instrumentableName - Name of the Instrumentable being requested.private InstrumentableProxy locateDeepestInstrumentableProxy(java.lang.String instrumentableName)
instrumentableName - Fully qualified name of the instrumentable being requested, or of any of its children.private void memoryInstruments()
private void threadInstruments()
private void testInstrumentSampleLeases()
void registerLeasedInstrumentSample(InstrumentSample instrumentSample)
instrumentSample - Leased InstrumentSample to register.private InstrumentableProxy[] updateInstrumentableProxyArray()
private InstrumentableDescriptorLocal[] updateInstrumentableDescriptorArray()
private void registerDummyInstrumentableInner(Instrumentable instrumentable,
InstrumentableProxy instrumentableProxy,
java.lang.String instrumentableName,
java.lang.String childName)
throws java.lang.Exception
instrumentable - The instrumentable that was registered below a dummy parent.instrumentableProxy - The proxy assigned to the current placeholder instrumentable.instrumentableName - The name of the current placeholder instrumentable.childName - The name of the child instrumentable to register. May contain further '.' characters.java.lang.Exception
private void registerInstrumentableInner(Instrumentable instrumentable,
InstrumentableProxy instrumentableProxy,
java.lang.String instrumentableName)
throws java.lang.Exception
Only called when m_semaphore is locked.
java.lang.Exceptionprotected void stateChanged()
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||