org.cougaar.core.thread
Class AgentLoadSensorPlugin
java.lang.Object
org.cougaar.util.GenericStateModelAdapter
org.cougaar.core.blackboard.BlackboardClientComponent
org.cougaar.core.plugin.ComponentPlugin
org.cougaar.core.thread.AgentLoadSensorPlugin
- All Implemented Interfaces:
- BlackboardClient, org.cougaar.core.component.Component, org.cougaar.core.component.ServiceProvider, PluginBase, Constants, ThreadListener, org.cougaar.util.GenericStateModel
public class AgentLoadSensorPlugin
- extends ComponentPlugin
- implements ThreadListener, Constants, org.cougaar.core.component.ServiceProvider
This Plugin provides the AgentLoadService for other Plugins
in the same Agent. The service implementation is an inner class.
In the Sensor
Data Flow pattern this class plays the role of Sensor
for load data (CPU load average, CPU) for Agents, Nodes and
Services.
- See Also:
AgentLoadRatePlugin,
AgentLoadServlet
| Fields inherited from interface org.cougaar.core.qos.metrics.Constants |
_1_SEC_AVG, _10_SEC_AVG, _100_SEC_AVG, _1000_SEC_AVG, BYTE_RATE, BYTES_FROM, BYTES_IN, BYTES_OUT, BYTES_TO, CONFIRMED_MEAS_CREDIBILITY, CPU_LOAD_AVG, CPU_LOAD_MJIPS, DEFAULT_CREDIBILITY, HOURLY_MEAS_CREDIBILITY, KEY_SEPR, MINUTE_MEAS_CREDIBILITY, MSG_FROM, MSG_IN, MSG_OUT, MSG_RATE, MSG_TO, NO_CREDIBILITY, ORACLE_CREDIBILITY, PATH_SEPR, PERSIST_SIZE_LAST, SecAvgKeySuffix, SECOND_MEAS_CREDIBILITY, SYS_BASE_CREDIBILITY, SYS_DEFAULT_CREDIBILITY, THREAD_SENSOR, USER_BASE_CREDIBILITY, USER_DEFAULT_CREDIBILITY |
| Fields inherited from interface org.cougaar.util.GenericStateModel |
ACTIVE, IDLE, LOADED, UNINITIALIZED, UNLOADED |
|
Method Summary |
protected void |
execute()
Called every time this component is scheduled to run. |
java.lang.Object |
getService(org.cougaar.core.component.ServiceBroker sb,
java.lang.Object requestor,
java.lang.Class serviceClass)
|
void |
load()
|
void |
releaseService(org.cougaar.core.component.ServiceBroker sb,
java.lang.Object requestor,
java.lang.Class serviceClass,
java.lang.Object service)
|
void |
rightGiven(java.lang.String scheduler)
Indicates that the given scheduler has been allocated a run-
right, which it will use to run one of its Schedulables. |
void |
rightReturned(java.lang.String scheduler)
Indicates that some running Schedulable managed by the given
Scheduler has given up its run-right. |
protected void |
setupSubscriptions()
Called once after initialization, as a "pre-execute()". |
void |
threadDequeued(Schedulable schedulable,
java.lang.Object consumer)
Indicates that the given Schedulable, which was previously
queued, has now been dequeued and is about to run. |
void |
threadQueued(Schedulable schedulable,
java.lang.Object consumer)
Indicates that the given Schedulable has been queued because it
was unable to to run. |
void |
threadStarted(Schedulable schedulable,
java.lang.Object consumer)
Indicates that the given Schedulable is about to start
running. |
void |
threadStopped(Schedulable schedulable,
java.lang.Object consumer)
Indicates that the given Schedulable has just stopped
running. |
| Methods inherited from class org.cougaar.core.blackboard.BlackboardClientComponent |
currentTimeMillis, cycle, getAgentIdentifier, getAlarmService, getBindingSite, getBlackboardClientName, getBlackboardService, getMessageAddress, getParameter, getParameters, getServiceBroker, halt, precycle, requestCycle, resume, setAgentIdentificationService, setAlarmService, setBindingSite, setBlackboardService, setParameter, setSchedulerService, setServiceBroker, setSuicideService, shouldExecute, start, stop, suspend, toString, unload, wasAwakened |
| Methods inherited from class org.cougaar.util.GenericStateModelAdapter |
getModelState, initialize, transitState |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.cougaar.util.GenericStateModel |
getModelState, halt, initialize, resume, start, stop, suspend, unload |
AgentLoadSensorPlugin
public AgentLoadSensorPlugin()
load
public void load()
- Specified by:
load in interface org.cougaar.util.GenericStateModel- Overrides:
load in class BlackboardClientComponent
setupSubscriptions
protected void setupSubscriptions()
- Description copied from class:
ComponentPlugin
- Called once after initialization, as a "pre-execute()".
- Specified by:
setupSubscriptions in class ComponentPlugin
execute
protected void execute()
- Description copied from class:
ComponentPlugin
- Called every time this component is scheduled to run.
- Specified by:
execute in class ComponentPlugin
getService
public java.lang.Object getService(org.cougaar.core.component.ServiceBroker sb,
java.lang.Object requestor,
java.lang.Class serviceClass)
- Specified by:
getService in interface org.cougaar.core.component.ServiceProvider
releaseService
public void releaseService(org.cougaar.core.component.ServiceBroker sb,
java.lang.Object requestor,
java.lang.Class serviceClass,
java.lang.Object service)
- Specified by:
releaseService in interface org.cougaar.core.component.ServiceProvider
threadQueued
public void threadQueued(Schedulable schedulable,
java.lang.Object consumer)
- Description copied from interface:
ThreadListener
- Indicates that the given Schedulable has been queued because it
was unable to to run.
- Specified by:
threadQueued in interface ThreadListener
threadDequeued
public void threadDequeued(Schedulable schedulable,
java.lang.Object consumer)
- Description copied from interface:
ThreadListener
- Indicates that the given Schedulable, which was previously
queued, has now been dequeued and is about to run.
- Specified by:
threadDequeued in interface ThreadListener
threadStarted
public void threadStarted(Schedulable schedulable,
java.lang.Object consumer)
- Description copied from interface:
ThreadListener
- Indicates that the given Schedulable is about to start
running. This will be called from within the Schedulable's own
thread.
- Specified by:
threadStarted in interface ThreadListener
threadStopped
public void threadStopped(Schedulable schedulable,
java.lang.Object consumer)
- Description copied from interface:
ThreadListener
- Indicates that the given Schedulable has just stopped
running. This will be called from within the Schedulable's own
thread.
- Specified by:
threadStopped in interface ThreadListener
rightGiven
public void rightGiven(java.lang.String scheduler)
- Description copied from interface:
ThreadListener
- Indicates that the given scheduler has been allocated a run-
right, which it will use to run one of its Schedulables. That
Schedulable might be a queued one or might be a new one asking
to start.
- Specified by:
rightGiven in interface ThreadListener
rightReturned
public void rightReturned(java.lang.String scheduler)
- Description copied from interface:
ThreadListener
- Indicates that some running Schedulable managed by the given
Scheduler has given up its run-right.
- Specified by:
rightReturned in interface ThreadListener