public class ReasonerAgent extends java.lang.Object implements LifeCycleAgent
Reasoners.LifeCycleAgent interface and will be
instantiated with a Reasoner, which will be started immediately. Furthermore it will wrap the running
Reasoner by a LifeCycleApp. Nevertheless, this class implements the control actions related to a
Reasoner, such as: "start", "sleep", "info" and "stop".| Modifier and Type | Field and Description |
|---|---|
private ProjectStatus |
myStatus
The current status of the reasoner agent.
|
private static long |
SHUTDOWN_CHECKTIME
Time to wait to check again if the worker has already been stopped, while
stop() is ending the worker
thread, before sending success. |
private Reasoner |
worker
The
Reasoner, a thread which provides reads the internal data format and estimates the current
reachability of the inhabitant. |
private java.lang.String |
workerName
The simple class name of the
worker. |
| Constructor and Description |
|---|
ReasonerAgent(Reasoner reasoner)
Create a new
ReasonerAgent which starts the supplied Reasoner as LifeCycleApp and
manages control messages for this Reasoner, such as "start", "stop", "info" and "sleep". |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getID()
the identifier of the Application.
|
JsonInfoMessage |
getInfoMessage()
Generating a Info Message.
|
void |
sleep()
the application no longer communicates with the Blackboard.
|
void |
start()
start with the actual work.
|
void |
stop()
shutting the agent down.
|
private ProjectStatus myStatus
private static final long SHUTDOWN_CHECKTIME
stop() is ending the worker
thread, before sending success.private Reasoner worker
Reasoner, a thread which provides reads the internal data format and estimates the current
reachability of the inhabitant.private java.lang.String workerName
worker.public ReasonerAgent(Reasoner reasoner)
ReasonerAgent which starts the supplied Reasoner as LifeCycleApp and
manages control messages for this Reasoner, such as "start", "stop", "info" and "sleep".reasoner - The Reasoner which shall be started and managed as LifeCycleApp.public final void sleep()
LifeCycleAgentsleep in interface LifeCycleAgentLifeCycleAgent.sleep()public final JsonInfoMessage getInfoMessage()
LifeCycleAgentgetInfoMessage in interface LifeCycleAgentJsonInfoMessage object describing the current systems state.LifeCycleAgent.getInfoMessage()public final void start()
LifeCycleAgentstart in interface LifeCycleAgentLifeCycleAgent.start()public final void stop()
LifeCycleAgentstop in interface LifeCycleAgentLifeCycleAgent.stop()public final java.lang.String getID()
LifeCycleAgentgetID in interface LifeCycleAgentString defined by ProjectInfo.REACHABILITY_AGENT_NAME.LifeCycleAgent.getID()