|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlab.coda.afecs.system.ABase
org.jlab.coda.afecs.archive.AAgent
public abstract class AAgent
JSA: Thomas Jefferson National Accelerator Facility
This software was developed under a United States Government license,
described in the NOTICE file included as part of this distribution.
Copyright (c), Aug 18, 2009
IAClientCommunication
), start processes, etc.
Subscribes AConstants.AgentInfoRequest
and messages.
Subscribes AConstants.AgentControlRequest
messages.
Includes agent data object AComponent
details
of wich is described in the cool configuration file.
Nested Class Summary | |
---|---|
class |
AAgent.AsyncProcessThread
Inner class that runs an async process in the separate thread. |
class |
AAgent.MonProcessThread
Inner class for running agent described periodic processes |
class |
AAgent.ReportDalogThread
Inner class for reporting to entire pub/sub space dalog messages. |
class |
AAgent.ReportLoadThread
Inner class for reporting to the Container admin the load, i.e. |
class |
AAgent.ReportStatusThread
Inner class for reporting to the superviosr agent/agents the state of this agent. |
class |
AAgent.ShellExecutionThread
Inner class extends Thread and runs the shell scripts |
Field Summary | |
---|---|
java.util.concurrent.atomic.AtomicBoolean |
AbortRequest
|
java.util.concurrent.atomic.AtomicBoolean |
activeMoveToState
|
int |
cMsgRequests
|
AComponent |
me
|
double |
myLoad
|
java.util.concurrent.ConcurrentHashMap<java.lang.String,AAgent.MonProcessThread> |
myMonProcesses
|
IAClientCommunication |
myPlugin
|
java.lang.String |
myStartTime
|
java.util.concurrent.atomic.AtomicBoolean |
ResetRequest
|
Fields inherited from class org.jlab.coda.afecs.system.ABase |
---|
myConfig, myCRCClientConnection, myName, myPlatformConnection, myRcDomainConnection |
Constructor Summary | |
---|---|
AAgent()
Basic constructor. |
Method Summary | |
---|---|
abstract void |
agentControlRequestAbort(java.lang.String initiator)
Abstract method of agent service/molvestate abort |
abstract void |
agentControlRequestClientReconnect(org.jlab.coda.cMsg.cMsgMessage msg)
|
abstract void |
agentControlRequestConfigure(AComponent ac)
|
abstract void |
agentControlRequestMoveToState(java.lang.String state)
|
abstract void |
agentControlRequestPlatformDisconnect()
This will disconnect agent from the platform. |
abstract void |
agentControlRequestReleaseComponent()
|
abstract void |
agentControlRequestReset(java.lang.String initiator)
Abstract method of agent reset |
abstract void |
agentControlrequestSetRunNumber(int runnum)
|
void |
configure(AComponent ad)
Configures agent based on the cool description |
void |
connect2cMsg(AComponent ad)
|
void |
differentiate(AComponent ad)
This method connects to the platform, completes basic subscriptions ( at this moment only AgentInfoRequest messages), registeres with the platform registrar, creats an instance of the representative component communication plugin, and starts the status reporting thread. |
boolean |
doSubscriptions()
Agent basic subscriptions. |
void |
executeProcess(AProcess p,
java.lang.String resultState)
The main process execution method. |
void |
executeProcess(java.lang.String pn)
Executes the process defined by the name |
boolean |
executeShellScript(AScript scr,
java.lang.String sn,
boolean before)
Method executes shell scripts. |
boolean |
isSet(AChannel c1,
AChannel c2)
Compares two AChannel objects |
void |
moveToState(java.lang.String sn)
Chaecks if the required state is known then moves to the state by executing state dependent processes. |
boolean |
register()
Register with the platform registration services |
boolean |
removeRegistration()
Sends the request to remove registration from the platform registration services |
boolean |
reportLoad()
Sends the request to the container to update load for this agent |
boolean |
reportStatus(boolean isObjectRequested)
Sends status ( payload of AComponent object) to every
one subscribing to the subject = session. |
void |
reset()
General reset N.B. |
void |
startDalogReporting()
Starts dalog reporting thread with the default AConstants.ADLRP
preiodicity. |
void |
startLoadReporting()
Starts load reporting thread with the default AConstants.ALRP
preiodicity. |
void |
startStatusReporting()
Starts status reporting thread. |
void |
stopDalogReporting()
Stops dalog reporting thread. |
void |
stopLoadReporting()
Stops load reporting thread. |
void |
stopMonProcesses()
Stops all started periodic processes, and clears the hashmap for the periodic processes. |
void |
stopStatusReporting()
Stops status reporting thread. |
abstract void |
supervisorControlRequestConfigure(AControl control)
|
void |
unsubscribeAll()
Unsubscribes agent info and control messages |
Methods inherited from class org.jlab.coda.afecs.system.ABase |
---|
B2O, connect, connect, connect, dalogMsg, dalogMsg, disconnect, getCurrentTime, getCurrentTime, getCurrentTimeInMs, getPlDescription, getPlEXPID, getPlMulticastUDL, getPlUDL, isConnected, isRCDomainConnected, msg2xml, msgForward, multicastConnect, multicastConnect, O2B, p2pSend, p2pSend, p2pSend, p2pSend, rcConnect, rcDomaindisconnect, rcMonitor, rcp2pSend, rcSend, rcSend, rcSend, rcSend, rcSend, rcSend, rcSend, removeUnixShellProcess, reporAlarmMsg, reportAlarmMsg, reportAlarmMsg, runShellCommand, send, send, send, send, send, send, send, sleep, updateHostUdl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public volatile java.util.concurrent.atomic.AtomicBoolean AbortRequest
public java.util.concurrent.atomic.AtomicBoolean activeMoveToState
public volatile int cMsgRequests
public AComponent me
public volatile double myLoad
public java.util.concurrent.ConcurrentHashMap<java.lang.String,AAgent.MonProcessThread> myMonProcesses
public IAClientCommunication myPlugin
public java.lang.String myStartTime
public volatile java.util.concurrent.atomic.AtomicBoolean ResetRequest
Constructor Detail |
---|
public AAgent()
Method Detail |
---|
public abstract void agentControlRequestAbort(java.lang.String initiator)
initiator
- agent name who initiates the resetpublic abstract void agentControlRequestClientReconnect(org.jlab.coda.cMsg.cMsgMessage msg)
public abstract void agentControlRequestConfigure(AComponent ac)
public abstract void agentControlRequestMoveToState(java.lang.String state)
public abstract void agentControlRequestPlatformDisconnect()
public abstract void agentControlRequestReleaseComponent()
public abstract void agentControlRequestReset(java.lang.String initiator)
initiator
- agent name who initiates the resetpublic abstract void agentControlrequestSetRunNumber(int runnum)
public void configure(AComponent ad)
ad
- AComponent
base component structure.public void connect2cMsg(AComponent ad)
public void differentiate(AComponent ad)
ad
- AComponent
objectpublic boolean doSubscriptions()
public void executeProcess(AProcess p, java.lang.String resultState)
p
- AProcess
referenceresultState
- state name that this agent must transition in case of successful process execution.public void executeProcess(java.lang.String pn)
pn
- the name of the process (String)public boolean executeShellScript(AScript scr, java.lang.String sn, boolean before)
scr
- AScript
objectsn
- The name of the statebefore
- Boolean value defines if script is running
before (true) or after (false) state transition
public boolean isSet(AChannel c1, AChannel c2)
AChannel
objects
c1
- AChannel object was setc2
- AChannel object read
AChannel.setValue
of c1
is equal to AChannel.getValue()
of c2.public void moveToState(java.lang.String sn)
sn
- The name of the statepublic boolean register()
public boolean removeRegistration()
public boolean reportLoad()
public boolean reportStatus(boolean isObjectRequested)
AComponent
object) to every
one subscribing to the subject = session.
N.B. This is a design choice. All supervisor/s must subscribe the subject session. This is done
in order to simplify the life of any graphical interface that is ready to visualize information
of the specific agent.
isObjectRequested
- if true we need to send entire AComponent
object for this agent to the requester. Otherwise we send only subset of the AComponent object including only
run time specific parameters as a payload items.
public void reset()
AConstants.booted
public void startDalogReporting()
AConstants.ADLRP
preiodicity.
public void startLoadReporting()
AConstants.ALRP
preiodicity.
public void startStatusReporting()
AConstants.ARP
is used.
public void stopDalogReporting()
public void stopLoadReporting()
public void stopMonProcesses()
public void stopStatusReporting()
public abstract void supervisorControlRequestConfigure(AControl control)
public void unsubscribeAll()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |