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