|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.cougaar.util.GenericStateModelAdapter
org.cougaar.core.blackboard.BlackboardClientComponent
public abstract class BlackboardClientComponent
This component is a standard base class for Components
that use the BlackboardService.
Plugins are the most common example of such components.
ComponentPlugin is an extension of this class.
Create a derived class by implementing setupSubscriptions() and execute().
Note that both "precycle()" and "cycle()" will be run by the scheduler. This means that the scheduling order in relation to other scheduled Components may be *random* (i.e. this BlackboardClientComponent might load first but be precycled last!). In general a Component should not make assumptions about the load or schedule ordering.
ComponentPlugin| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.cougaar.core.blackboard.BlackboardClient |
|---|
BlackboardClient.Local |
| Field Summary | |
|---|---|
protected MessageAddress |
agentId
|
protected AgentIdentificationService |
agentIdentificationService
|
protected AlarmService |
alarmService
|
protected BlackboardService |
blackboard
|
protected java.lang.String |
blackboardClientName
|
| Fields inherited from interface org.cougaar.util.GenericStateModel |
|---|
ACTIVE, IDLE, LOADED, UNINITIALIZED, UNLOADED |
| Fields inherited from interface org.cougaar.core.blackboard.BlackboardClient |
|---|
current |
| Constructor Summary | |
|---|---|
BlackboardClientComponent()
|
|
| Method Summary | |
|---|---|
long |
currentTimeMillis()
Get the current execution time (bug 2515). |
protected void |
cycle()
|
protected abstract void |
execute()
Called every time this component is scheduled to run. |
protected MessageAddress |
getAgentIdentifier()
Get the local agent's address. |
protected AlarmService |
getAlarmService()
Get the alarm service, for subclass use. |
protected org.cougaar.core.component.BindingSite |
getBindingSite()
Get the binding site, for subclass use. |
java.lang.String |
getBlackboardClientName()
Return a name for this BlackboardClient. |
protected BlackboardService |
getBlackboardService()
Get the blackboard service, for subclass use. |
protected MessageAddress |
getMessageAddress()
Deprecated. Use getAgentIdentifier() |
java.lang.Object |
getParameter()
|
java.util.Collection |
getParameters()
Get any Component parameters passed by the instantiator. |
protected org.cougaar.core.component.ServiceBroker |
getServiceBroker()
Get the ServiceBroker, for subclass use. |
void |
halt()
|
void |
load()
|
protected void |
precycle()
|
protected void |
requestCycle()
|
void |
resume()
|
void |
setAgentIdentificationService(AgentIdentificationService ais)
|
void |
setAlarmService(AlarmService s)
|
void |
setBindingSite(org.cougaar.core.component.BindingSite bs)
Binding site is set by reflection at creation-time. |
void |
setBlackboardService(BlackboardService bs)
|
void |
setParameter(java.lang.Object param)
Called just after construction (via introspection) by the loader if a non-null parameter Object was specified by the ComponentDescription. |
void |
setSchedulerService(SchedulerService ss)
|
void |
setServiceBroker(org.cougaar.core.component.ServiceBroker sb)
ServiceBroker is set by reflection at creation-time. |
void |
setSuicideService(SuicideService ss)
|
protected abstract void |
setupSubscriptions()
Called once after initialization, as a pre- execute(). |
protected boolean |
shouldExecute()
|
void |
start()
|
void |
stop()
|
void |
suspend()
|
java.lang.String |
toString()
|
void |
unload()
|
protected boolean |
wasAwakened()
True IFF were we awakened explicitly (i.e. we were asked to run even if no subscription activity has happened). |
| 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, initialize |
| Field Detail |
|---|
protected MessageAddress agentId
protected BlackboardService blackboard
protected AlarmService alarmService
protected AgentIdentificationService agentIdentificationService
protected java.lang.String blackboardClientName
| Constructor Detail |
|---|
public BlackboardClientComponent()
| Method Detail |
|---|
public void setParameter(java.lang.Object param)
public java.lang.Object getParameter()
setParameter(java.lang.Object)public java.util.Collection getParameters()
public void setBindingSite(org.cougaar.core.component.BindingSite bs)
protected org.cougaar.core.component.BindingSite getBindingSite()
public void setServiceBroker(org.cougaar.core.component.ServiceBroker sb)
protected org.cougaar.core.component.ServiceBroker getServiceBroker()
public final void setSchedulerService(SchedulerService ss)
public final void setBlackboardService(BlackboardService bs)
public final void setAlarmService(AlarmService s)
public final void setAgentIdentificationService(AgentIdentificationService ais)
public void setSuicideService(SuicideService ss)
protected BlackboardService getBlackboardService()
protected AlarmService getAlarmService()
protected final void requestCycle()
public void load()
load in interface org.cougaar.util.GenericStateModelload in class org.cougaar.util.GenericStateModelAdapterpublic void start()
start in interface org.cougaar.util.GenericStateModelstart in class org.cougaar.util.GenericStateModelAdapterpublic void suspend()
suspend in interface org.cougaar.util.GenericStateModelsuspend in class org.cougaar.util.GenericStateModelAdapterpublic void resume()
resume in interface org.cougaar.util.GenericStateModelresume in class org.cougaar.util.GenericStateModelAdapterpublic void stop()
stop in interface org.cougaar.util.GenericStateModelstop in class org.cougaar.util.GenericStateModelAdapterpublic void halt()
halt in interface org.cougaar.util.GenericStateModelhalt in class org.cougaar.util.GenericStateModelAdapterpublic void unload()
unload in interface org.cougaar.util.GenericStateModelunload in class org.cougaar.util.GenericStateModelAdapterprotected void precycle()
protected void cycle()
protected boolean shouldExecute()
protected MessageAddress getAgentIdentifier()
protected MessageAddress getMessageAddress()
protected abstract void setupSubscriptions()
execute().
protected abstract void execute()
protected final boolean wasAwakened()
public java.lang.String getBlackboardClientName()
BlackboardClient
getBlackboardClientName in interface BlackboardClientpublic long currentTimeMillis()
BlackboardClient
currentTimeMillis in interface BlackboardClientpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||