public class ReasonerAgent extends java.lang.Object implements LifeCycleAgent
Reasoner
s.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()
LifeCycleAgent
sleep
in interface LifeCycleAgent
LifeCycleAgent.sleep()
public final JsonInfoMessage getInfoMessage()
LifeCycleAgent
getInfoMessage
in interface LifeCycleAgent
JsonInfoMessage
object describing the current systems state.LifeCycleAgent.getInfoMessage()
public final void start()
LifeCycleAgent
start
in interface LifeCycleAgent
LifeCycleAgent.start()
public final void stop()
LifeCycleAgent
stop
in interface LifeCycleAgent
LifeCycleAgent.stop()
public final java.lang.String getID()
LifeCycleAgent
getID
in interface LifeCycleAgent
String
defined by ProjectInfo.REACHABILITY_AGENT_NAME
.LifeCycleAgent.getID()