public class ReachabilityAgent extends java.lang.Object implements LifeCycleAgent
Modifier and Type | Field and Description |
---|---|
private ProjectStatus |
myStatus
The current project status of the reachability agent as
ProjectStatus object. |
private static long |
SHUTDOWN_CHECKTIME
Time to wait before check again if the worker has already been stopped, while
stop() is ending the
worker thread, before sending success. |
private ReachabilityWorker |
worker
The
ReachabilityWorker , a thread determining the current state of reachability of an inhabitant. |
Constructor and Description |
---|
ReachabilityAgent()
Creates a new
ReachabilityAgent which starts a ReachabilityWorker to determine the inhabitants
current state of reachability. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getID()
the identifier of the Application.
|
JsonInfoMessage |
getInfoMessage()
Generating a Info Message.
|
static void |
main(java.lang.String[] args)
This method starts and runs a new
ReachabilityAgent . |
void |
sleep()
the application no longer communicates with the Blackboard.
|
void |
start()
start with the actual work.
|
void |
stop()
shutting the agent down.
|
private static final long SHUTDOWN_CHECKTIME
stop()
is ending the
worker thread, before sending success.private ReachabilityWorker worker
ReachabilityWorker
, a thread determining the current state of reachability of an inhabitant.private ProjectStatus myStatus
ProjectStatus
object.public ReachabilityAgent()
ReachabilityAgent
which starts a ReachabilityWorker
to determine the inhabitants
current state of reachability.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()
public static void main(java.lang.String[] args)
ReachabilityAgent
.args
- The command line arguments as array of String
.