AgentModule

Base class for all agent modules

class DIRAC.Core.Base.AgentModule.AgentModule(agentName, loadName, baseAgentName=False, properties={})

Bases: object

Base class for all agent modules

This class is used by the AgentReactor Class to steer the execution of DIRAC Agents.

For this purpose the following methods are used: - am_initialize() just after instantiated - am_getPollingTime() to set the execution frequency - am_getMaxCycles() to determine the number of cycles - am_go() for the actual execution of one cycle

Before each iteration, the following methods are used to determine if the new cycle is to be started. - am_getModuleParam( ‘alive’ ) - am_checkStopAgentFile() - am_removeStopAgentFile()

To start new execution cycle the following methods are used - am_getCyclesDone() - am_setOption( ‘MaxCycles’, maxCycles )

At the same time it provides all Agents with common interface. All Agent class must inherit from this base class and must implement at least the following method: - execute() main method called in the agent cycle

Additionally they may provide: - initialize() for initial settings - finalize() the graceful exit

  • beginExecution() before each execution cycle
  • endExecution() at the end of each execution cycle

The agent can be stopped either by a signal or by creating a ‘stop_agent’ file in the controlDirectory defined in the agent configuration

am_Enabled()
am_checkStopAgentFile()
am_createStopAgentFile()
am_disableMonitoring()
am_getBasePath()
am_getControlDirectory()
am_getCyclesDone()
am_getMaxCycles()
am_getModuleParam(optionName)
am_getOption(optionName, defaultValue=None)
am_getPollingTime()
am_getShifterProxyLocation()
am_getStopAgentFile()
am_getWatchdogTime()
am_getWorkDirectory()
am_go()
am_initialize(*initArgs)
am_monitoringEnabled()
am_removeStopAgentFile()
am_secureCall(functor, args=(), name=False)
am_setModuleParam(optionName, value)
am_setOption(optionName, value)
am_stopExecution()
beginExecution()
endExecution()
execute()
finalize()
initialize(*args, **kwargs)