org.jlab.coda.afecs.agent
Class ASupervisor

java.lang.Object
  extended by org.jlab.coda.afecs.system.ABase
      extended by org.jlab.coda.afecs.archive.AAgent
          extended by org.jlab.coda.afecs.archive.ASupervisor

public class ASupervisor
extends 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 17, 2009

Afecs control system superviosr agent. Owns and executes services. Each service itself is a state machine.

Version:
1.4
Author:
Vardan Gyurjyan

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jlab.coda.afecs.agent.AAgent
AAgent.AsyncProcessThread, AAgent.MonProcessThread, AAgent.ReportDalogThread, AAgent.ReportLoadThread, AAgent.ReportStatusThread, AAgent.ShellExecutionThread
 
Field Summary
 
Fields inherited from class org.jlab.coda.afecs.agent.AAgent
AbortRequest, activeMoveToState, cMsgRequests, me, myLoad, myMonProcesses, myPlugin, myStartTime, ResetRequest
 
Fields inherited from class org.jlab.coda.afecs.system.ABase
myConfig, myCRCClientConnection, myName, myPlatformConnection, myRcDomainConnection
 
Constructor Summary
ASupervisor(AComponent ad)
          No arg constructor calls parent AAgent constructor
 
Method Summary
 void agentControlRequestAbort(java.lang.String initiator)
          This method gets called when one of the supervised agent requests abort.
 void agentControlRequestClientReconnect(org.jlab.coda.cMsg.cMsgMessage msg)
           
 void agentControlRequestConfigure(AComponent ac)
           
 void agentControlRequestMoveToState(java.lang.String state)
          Request supervisor to move to the state.
 void agentControlRequestPlatformDisconnect()
          This will disconnect agent from the platform.
 void agentControlRequestReleaseComponent()
          This will tell all the agents under its control to release their components.
 void agentControlRequestReset(java.lang.String initiator)
          This method gets called when one of the supervised agents requests reset.
 void agentControlrequestSetRunNumber(int runnum)
           
 void stopServiceExecutionThread()
          Stops service execution thread
 void supAgentDifferentiate(AControl c)
          Configure method.
 void supAgentReset()
          Supervisor reset method.
 void supervisorControlRequestConfigure(AControl control)
           
 
Methods inherited from class org.jlab.coda.afecs.agent.AAgent
configure, connect2cMsg, differentiate, doSubscriptions, executeProcess, executeProcess, executeShellScript, isSet, moveToState, register, removeRegistration, reportLoad, reportStatus, reset, startDalogReporting, startLoadReporting, startStatusReporting, stopDalogReporting, stopLoadReporting, stopMonProcesses, stopStatusReporting, unsubscribeAll
 
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
 

Constructor Detail

ASupervisor

public ASupervisor(AComponent ad)
No arg constructor calls parent AAgent constructor

Parameters:
ad - AComponent object reference
Method Detail

agentControlRequestAbort

public void agentControlRequestAbort(java.lang.String initiator)
This method gets called when one of the supervised agent requests abort.

Specified by:
agentControlRequestAbort in class AAgent
Parameters:
initiator - agent name who initiates the abort

agentControlRequestClientReconnect

public void agentControlRequestClientReconnect(org.jlab.coda.cMsg.cMsgMessage msg)
Specified by:
agentControlRequestClientReconnect in class AAgent

agentControlRequestConfigure

public void agentControlRequestConfigure(AComponent ac)
Specified by:
agentControlRequestConfigure in class AAgent

agentControlRequestMoveToState

public void agentControlRequestMoveToState(java.lang.String state)
Request supervisor to move to the state. Used by GUI to send mesage to transition to the reseted state for e.g.

Specified by:
agentControlRequestMoveToState in class AAgent
Parameters:
state - The name of the state to be moved to.

agentControlRequestPlatformDisconnect

public void agentControlRequestPlatformDisconnect()
Description copied from class: AAgent
This will disconnect agent from the platform. i.e. it will be garbage collected.

Specified by:
agentControlRequestPlatformDisconnect in class AAgent

agentControlRequestReleaseComponent

public void agentControlRequestReleaseComponent()
This will tell all the agents under its control to release their components.

Specified by:
agentControlRequestReleaseComponent in class AAgent

agentControlRequestReset

public void agentControlRequestReset(java.lang.String initiator)
This method gets called when one of the supervised agents requests reset.

Specified by:
agentControlRequestReset in class AAgent
Parameters:
initiator - agent name who initiates the reset

agentControlrequestSetRunNumber

public void agentControlrequestSetRunNumber(int runnum)
Specified by:
agentControlrequestSetRunNumber in class AAgent

stopServiceExecutionThread

public void stopServiceExecutionThread()
Stops service execution thread


supAgentDifferentiate

public void supAgentDifferentiate(AControl c)
Configure method. Calls AAgent.differentiate(org.jlab.coda.afecs.cool.ontology.AComponent) method. Calls supervisor reset. First calls AAgent.differentiate(org.jlab.coda.afecs.cool.ontology.AComponent) method by setting its state to configuring, and then calls supervisor differentiate methos

Parameters:
c - AComponent object reference, as a result CParser parsing rdf configuration file for the configured control.
See Also:
Next it sets the required state to {@link org.jlab.coda.afecs.system.AConstants\#booted}. Starts supervised agents state watching thread that will look for {@link org.jlab.coda.afecs.system.AConstants#configured} message coming from supervised agents.

supAgentReset

public void supAgentReset()
Supervisor reset method. First calls AAgent.reset() method. Stops active service execution thread. Stops agent states watching thread. Clears all internal registration storages. Set state of this agent = AConstants.configured


supervisorControlRequestConfigure

public void supervisorControlRequestConfigure(AControl control)
Specified by:
supervisorControlRequestConfigure in class AAgent