Package fr.dyade.aaa.agent
Class Engine
- java.lang.Object
-
- fr.dyade.aaa.agent.Engine
-
- All Implemented Interfaces:
AgentEngine,EngineMBean,MessageComparator,MessageConsumer,Runnable
class Engine extends Object implements Runnable, AgentEngine, EngineMBean
TheEngineclass provides multiprogramming of agents. It realizes the program loop which successively gets the notifications from the message queue and calls the relevant reaction function member of the target agent. The engine's basic behaviour is:While (true) { // get next message in channel Message msg = qin.get(); // get the agent to process event Agent agent = load(msg.to); // execute relevant reaction, all notification sent during this // reaction is inserted into persistent queue in order to processed // by the channel. agent.react(msg.from, msg.not); // save changes, then commit. <BEGIN TRANSACTION> qin.pop(); channel.dispatch(); agent.save(); <COMMIT TRANSACTION> }The
Engineclass ensures the atomic handling of an agent reacting to a notification:- if the reaction completes, a COMMIT ensures all changes related to the reaction are committed (state change of the agent, notifications signaled during the reaction, deletion of the handled notification);
- if anything goes wrong during the reaction, a ROLLBACK undoes the changes; depending on the error kind it may be necessary to execute additional operations to resynchronize the database and the memory objects, and to allow the main program to continue.
Handling errors.Two types of errors may occur: errors of first type are detected in the source code and signaled by an
Exception; serious errors lead to anErrorbeing raised then the engine exits. In the first case the exception may be handled at any level, even partially. Most of them are signaled up to the engine loop. Two cases are then distinguished depending on the recovery policy:- if
recoveryPolicyis set toRP_EXC_NOT(default value) then the agent state and the message queue are restored (ROLLBACK); anExceptionNotificationnotification is sent to the sender and the engine may then proceed with next notification; - if
recoveryPolicyis set toRP_EXITthe engine stops the agent server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classEngine.EngineAverageLoadTask
-
Field Summary
Fields Modifier and Type Field Description (package private) AgentagentThe current agent running.booleanagentProfilingBoolean value indicating if the agent profiling is on, by default false.(package private) Hashtable<AgentId,Agent>agentsThis table is used to maintain a list of agents already in memory using the AgentId as primary key.(package private) AverageCPUTaskaverageCPUTaskThe average use of CPU by the Engine thread during last minute.(package private) Engine.EngineAverageLoadTaskaverageLoadTaskprotected booleancanStopBoolean variable used to stop the engine properly.private longcommitTimeTime consumed during reaction commit.private static booleanDEBUG(package private) Vector<AgentId>fixedAgentIdListVector containing id's of all fixed agents.protected booleanisRunningBoolean variable used to stop the engine properly.private Loggerlogmonprivate booleanmodifiedTrue if the timestamp is modified since last save.protected Queuemq(package private) MessagemsgThe message in progress.private Stringname(package private) intNbMaxAgentsMaximum number of memory loaded agents.protected booleanneedToBeCommited(package private) booleannoTxIfTransientFlag to avoid transaction when not needed.(package private) longnowVirtual time counter use in FIFO swap-in/swap-out mechanisms.private booleanpersistentPushprotected MessageQueueqinQueue of messages to be delivered to local agents.private longreactTimeTime consumed during agent's reaction.(package private) intrecoveryPolicyrecovery policy in case of exception in agent specific code.(package private) static intRP_EXC_NOTSendExceptionNotificationnotification in case of exception in agent specific code.(package private) static intRP_EXITStop agent server in case of exception in agent specific code.(package private) static String[]rpStringsString representations ofRP_*constant values for therecoveryPolicyvariable.private intstampLogical timestamp information for messages in "local" domain.private byte[]stampBufBuffer used to optimize(package private) EngineThreadthreadThe active component of this engine.protected longtimeout(package private) longworkInProgressthe tick counter that reflects activity in engine.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEngine()Initializes a newEngineobject (can only be used by subclasses).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidabort(Exception exc)Abort the agent reaction in case of error during execution.(package private) voidaddFixedAgentId(AgentId id)Adds anAgentIdin thefixedAgentIdListVector.(package private) voidclean()Cleans the Channel queue of all pushed notifications.(package private) voidcommit()Commit the agent reaction in case of right termination: suppress the processed notification from message queue, then deletes it ; push all new notifications in qin and qout, and saves them ; saves the agent state ; then commit the transaction to validate all changes.(package private) voidcreateAgent(Agent agent)Creates and initializes an agent.voidcreateAgent(AgentId id, Agent agent)Creates and initializes an agent.voiddelete()This operation always throws an IllegalStateException.voiddeleteAgent(AgentId id)Deletes an agent.(package private) voiddispatch()StringdumpAgent(AgentId id)Returns a string representation of the specified agent.StringdumpAgent(String id)Returns a string representation of the specified agent.(package private) voidgarbage()Thegarbagemethod should be called regularly , to swap out from memory all the agents which have not been accessed for a time.intgetAverageCPU()Returns the average use of CPU by the Engine thread during last minute.floatgetAverageLoad1()Returns the load averages for the last minute.floatgetAverageLoad15()Returns the load averages for the past 15 minutes.floatgetAverageLoad5()Returns the load averages for the past 5 minutes.longgetCommitTime()Returns the total commit time calculated for this engine.StringgetDomainName()Returns the corresponding domain's name.(package private) AgentId[]getLoadedAgentIdlist()Method used for debug and monitoring.StringgetName()Returns thisEngine's name.intgetNbAgents()Returns the number of agents actually loaded in memory.intgetNbFixedAgents()Returns the number of fixed agents.intgetNbMaxAgents()Returns the maximum number of agents loaded in memory.intgetNbMessages()Gets the number of messages posted to this engine since creation.longgetNbReactions()Returns the number of agent's reaction since last boot.intgetNbWaitingMessages()Gets the number of waiting messages in this engine.MessageQueuegetQueue()Get this engine'sMessageQueueqin.longgetReactTime()Returns the total reaction time calculated for this engine.StringgetRunningAgent()Returns the unique id. of the running agent if any, null otherwise.private intgetStamp()Gets the current value of stamp counter.longgetWorkInProgress()Returns the tick counter that reflects activity in engine.voidincWorkInProgress()Increments the tick counter that reflects activity in engine.voidinit(AgentEngineContext agentEngineContext)Initializes the engine.voidinsert(Message msg)Insert a message in theMessageQueue.booleanisAgentProfiling()Returns true if the agent profiling is on.booleanisEngineThread()Checks if the current thread calling this method belongs to the engine.booleanisNoTxIfTransient()Returns the flag to avoid transactions.booleanisPrior(Message m1, Message m2)Compares the 2 messages for time ordering.booleanisRunning()Tests if the engine is alive.(package private) Agentload(AgentId id)Theloadmethod return theAgentobject designed by theAgentIdparameter.(package private) static EnginenewInstance()Creates a new instance of Engine (real class depends of server type).protected voidonTimeOut()voidpost(Message msg)Adds a message in "ready to deliver" list.voidpostAndValidate(Message msg)Posts a message and validates it at the same time.voidpush(AgentId from, AgentId to, Notification not)Push a new message in temporary queue until the end of current reaction.voidpush(AgentId to, Notification not)Push a new message in temporary queue until the end of current reaction.(package private) Agentreload(AgentId id)Thereloadmethod return theAgentobject loaded from the storage.(package private) voidremoveFixedAgentId(AgentId id)Removes anAgentIdin thefixedAgentIdListVector.Stringreport()Returns a report about the distribution of messages type in queue.voidresetAverageLoad()voidresetCommitTime()reset the commitTimevoidresetReactTime()reset the reactTimevoidresetTimer()Reset reactTime and commitTimevoidrestore()Restores logical clock information from persistent storage.voidrun()Main loop of agent serverEngine.voidsave()Saves logical clock information to persistent storage.voidsetAgentProfiling(boolean agentProfiling)Sets the agent profiling.voidsetNbMaxAgents(int NbMaxAgents)Sets the maximum number of agents that can be loaded simultaneously in memory.protected voidstamp(Message msg)Sets the stamp of the given message.voidstart()Causes this engine to begin execution.voidstop()Forces the engine to stop executing.(package private) voidterminate()StringtoString()Returns a string representation of this engine.voidvalidate()Validates all messages pushed in queue during transaction session.
-
-
-
Field Detail
-
DEBUG
private static final boolean DEBUG
-
logmon
private final Logger logmon
-
qin
protected MessageQueue qin
Queue of messages to be delivered to local agents.
-
isRunning
protected volatile boolean isRunning
Boolean variable used to stop the engine properly. The engine tests this variable between each reaction, and stops if it is false.
-
canStop
protected volatile boolean canStop
Boolean variable used to stop the engine properly. If this variable is true then the engine is waiting and it can interrupted, else it handles a notification and it will exit after (the engine tests theisRunningvariable between each reaction)
-
stamp
private int stamp
Logical timestamp information for messages in "local" domain.
-
stampBuf
private byte[] stampBuf
Buffer used to optimize
-
modified
private boolean modified
True if the timestamp is modified since last save.
-
agents
Hashtable<AgentId,Agent> agents
This table is used to maintain a list of agents already in memory using the AgentId as primary key.
-
now
long now
Virtual time counter use in FIFO swap-in/swap-out mechanisms.
-
NbMaxAgents
int NbMaxAgents
Maximum number of memory loaded agents.
-
noTxIfTransient
boolean noTxIfTransient
Flag to avoid transaction when not needed. By default true, we run a transaction only if there is transaction operations: - incoming persistent notification, - persistent objects modifications, - outgoing persistent notifications. The value could be set using "NoTxIfTransient" property.
-
agent
Agent agent
The current agent running.
-
msg
Message msg
The message in progress.
-
thread
EngineThread thread
The active component of this engine.
-
RP_EXC_NOT
static final int RP_EXC_NOT
SendExceptionNotificationnotification in case of exception in agent specific code. Constant value for therecoveryPolicyvariable.- See Also:
- Constant Field Values
-
RP_EXIT
static final int RP_EXIT
Stop agent server in case of exception in agent specific code. Constant value for therecoveryPolicyvariable.- See Also:
- Constant Field Values
-
rpStrings
static final String[] rpStrings
String representations ofRP_*constant values for therecoveryPolicyvariable.
-
recoveryPolicy
int recoveryPolicy
recovery policy in case of exception in agent specific code. Default value isRP_EXC_NOT.
-
name
private String name
-
mq
protected Queue mq
-
persistentPush
private boolean persistentPush
-
needToBeCommited
protected boolean needToBeCommited
-
timeout
protected long timeout
-
agentProfiling
public boolean agentProfiling
Boolean value indicating if the agent profiling is on, by default false. If true, the cumulative time of reaction and commit is kept for each agent. In addition the total reaction and commit time is calculated for this engine. This value can be adjusted through the AgentProfiling system property.
-
reactTime
private long reactTime
Time consumed during agent's reaction.
-
commitTime
private long commitTime
Time consumed during reaction commit.
-
workInProgress
long workInProgress
the tick counter that reflects activity in engine.
-
averageCPUTask
AverageCPUTask averageCPUTask
The average use of CPU by the Engine thread during last minute.
-
averageLoadTask
Engine.EngineAverageLoadTask averageLoadTask
-
-
Method Detail
-
getNbReactions
public long getNbReactions()
Returns the number of agent's reaction since last boot.- Specified by:
getNbReactionsin interfaceAgentEngine- Specified by:
getNbReactionsin interfaceEngineMBean- Returns:
- the number of agent's reaction since last boot
-
getNbMaxAgents
public int getNbMaxAgents()
Returns the maximum number of agents loaded in memory.- Specified by:
getNbMaxAgentsin interfaceEngineMBean- Returns:
- the maximum number of agents loaded in memory
-
setNbMaxAgents
public void setNbMaxAgents(int NbMaxAgents)
Sets the maximum number of agents that can be loaded simultaneously in memory.- Specified by:
setNbMaxAgentsin interfaceEngineMBean- Parameters:
NbMaxAgents- the maximum number of agents
-
getNbAgents
public int getNbAgents()
Returns the number of agents actually loaded in memory.- Specified by:
getNbAgentsin interfaceEngineMBean- Returns:
- the maximum number of agents actually loaded in memory
-
getNbMessages
public int getNbMessages()
Gets the number of messages posted to this engine since creation. return the number of messages.- Specified by:
getNbMessagesin interfaceEngineMBean- Returns:
- the number of messages.
-
getNbWaitingMessages
public int getNbWaitingMessages()
Gets the number of waiting messages in this engine. return the number of waiting messages.- Specified by:
getNbWaitingMessagesin interfaceAgentEngine- Specified by:
getNbWaitingMessagesin interfaceEngineMBean- Returns:
- the number of waiting messages.
-
getNbFixedAgents
public int getNbFixedAgents()
Returns the number of fixed agents.- Specified by:
getNbFixedAgentsin interfaceEngineMBean- Returns:
- the number of fixed agents
-
isNoTxIfTransient
public boolean isNoTxIfTransient()
Returns the flag to avoid transactions.- Specified by:
isNoTxIfTransientin interfaceAgentEngine- Specified by:
isNoTxIfTransientin interfaceEngineMBean- Returns:
- the flag to avoid transactions
-
getRunningAgent
public String getRunningAgent()
Returns the unique id. of the running agent if any, null otherwise.- Specified by:
getRunningAgentin interfaceAgentEngine- Specified by:
getRunningAgentin interfaceEngineMBean- Returns:
- the unique id. of the running agent if any, null otherwise.
-
getName
public final String getName()
Returns thisEngine's name.- Specified by:
getNamein interfaceEngineMBean- Specified by:
getNamein interfaceMessageConsumer- Returns:
- this
Engine's name.
-
getDomainName
public final String getDomainName()
Returns the corresponding domain's name.- Specified by:
getDomainNamein interfaceMessageConsumer- Returns:
- this domain's name.
-
newInstance
static Engine newInstance() throws Exception
Creates a new instance of Engine (real class depends of server type).- Returns:
- the corresponding
engine's instance. - Throws:
Exception- an error occurs.
-
push
public final void push(AgentId from, AgentId to, Notification not)
Push a new message in temporary queue until the end of current reaction. As this method is only called by engine's thread it does not need to be synchronized.- Specified by:
pushin interfaceAgentEngine- Parameters:
from- the sourceto- the destinationnot- the notification to push
-
push
public final void push(AgentId to, Notification not)
Push a new message in temporary queue until the end of current reaction. As this method is only called by engine's thread it does not need to be synchronized.- Specified by:
pushin interfaceAgentEngine- Parameters:
to- the destinationnot- the notification to push
-
dispatch
final void dispatch() throws ExceptionDispatch messages between theMessageConsumer:Enginecomponent andNetworkcomponents.Handle persistent information in respect with engine transaction.
Be careful, this method must only be used during a transaction in order to ensure the mutual exclusion.- Throws:
IOException- error when accessing the local persistent storage.Exception
-
clean
final void clean()
Cleans the Channel queue of all pushed notifications.
Be careful, this method must only be used during a transaction in order to ensure the mutual exclusion.
-
init
public void init(AgentEngineContext agentEngineContext) throws Exception
Description copied from interface:AgentEngineInitializes the engine. TheAgentEngineContextparameter should be for the unique private use of thisAgentEngineand should not be shared with any other components otherwise the agent server security would be broken.- Specified by:
initin interfaceAgentEngine- Parameters:
agentEngineContext- context enabling thisAgentEngineto invoke operations that cannot be accessed outside of thefr.dyade.aaa.agentpackage. TheAgentEngineContextshould be for the unique private use of thisAgentEngineand should not be shared with any other components otherwise the agent server security would be broken.- Throws:
Exception- an error occurs.
-
terminate
void terminate()
-
createAgent
public final void createAgent(AgentId id, Agent agent) throws Exception
Creates and initializes an agent.- Specified by:
createAgentin interfaceAgentEngine- Parameters:
agent- agent object to createid- the unique identifier- Throws:
Exception- unspecialized exception
-
createAgent
final void createAgent(Agent agent) throws Exception
Creates and initializes an agent.- Parameters:
agent- agent object to create- Throws:
Exception- unspecialized exception
-
deleteAgent
public void deleteAgent(AgentId id) throws Exception
Deletes an agent.- Specified by:
deleteAgentin interfaceAgentEngine- Parameters:
id- unique identifier of agent to delete- Throws:
Exception- unspecialized exception
-
garbage
void garbage()
Thegarbagemethod should be called regularly , to swap out from memory all the agents which have not been accessed for a time.
-
removeFixedAgentId
void removeFixedAgentId(AgentId id) throws IOException
Removes anAgentIdin thefixedAgentIdListVector.- Parameters:
id- theAgentIdof no more used fixed agent.- Throws:
IOException- an error occurs.
-
addFixedAgentId
void addFixedAgentId(AgentId id) throws IOException
Adds anAgentIdin thefixedAgentIdListVector.- Parameters:
id- theAgentIdof new fixed agent.- Throws:
IOException- an error occurs.
-
getLoadedAgentIdlist
AgentId[] getLoadedAgentIdlist()
Method used for debug and monitoring. It returns an enumeration of all agents loaded in memory.- Returns:
- an array containing the unique identifier of all agents in memory.
-
dumpAgent
public String dumpAgent(String id) throws Exception
Returns a string representation of the specified agent.- Specified by:
dumpAgentin interfaceEngineMBean- Parameters:
id- The string representation of the agent's unique identification.- Returns:
- A string representation of the specified agent.
- Throws:
Exception- an error occurs.- See Also:
dumpAgent(AgentId)
-
dumpAgent
public String dumpAgent(AgentId id) throws IOException, ClassNotFoundException
Returns a string representation of the specified agent. If the agent is not present it is loaded in memory, be careful it is not initialized (agentInitialize) nor cached in agents vector.- Specified by:
dumpAgentin interfaceAgentEngine- Parameters:
id- The agent's unique identification.- Returns:
- A string representation of specified agent.
- Throws:
IOException- an error occurs.ClassNotFoundException- an error occurs.
-
load
final Agent load(AgentId id) throws IOException, ClassNotFoundException, Exception
Theloadmethod return theAgentobject designed by theAgentIdparameter. If theAgentobject is not already present in the server memory, it is loaded from the storage. Be careful, if the save method can be overloaded to optimize the save process, the load procedure used by engine is always load.- Parameters:
id- The agent identification.- Returns:
- The corresponding agent.
- Throws:
IOException- If an I/O error occurs.ClassNotFoundException- Should never happen (the agent has already been loaded in deploy).UnknownAgentException- There is no corresponding agent on secondary storage.Exception- when executing class specific initialization
-
reload
final Agent reload(AgentId id) throws IOException, ClassNotFoundException, Exception
Thereloadmethod return theAgentobject loaded from the storage.- Parameters:
id- The agent identification.- Returns:
- The corresponding agent.
- Throws:
IOException- when accessing the stored imageClassNotFoundException- if the stored image class may not be foundException- unspecialized exception
-
insert
public void insert(Message msg)
Insert a message in theMessageQueue. This method is used during initialization to restore the component state from persistent storage.- Specified by:
insertin interfaceMessageConsumer- Parameters:
msg- the message
-
validate
public void validate()
Validates all messages pushed in queue during transaction session.- Specified by:
validatein interfaceMessageConsumer
-
start
public void start()
Causes this engine to begin execution.- Specified by:
startin interfaceEngineMBean- Specified by:
startin interfaceMessageConsumer- See Also:
stop()
-
stop
public void stop()
Forces the engine to stop executing.- Specified by:
stopin interfaceEngineMBean- Specified by:
stopin interfaceMessageConsumer- See Also:
start()
-
getQueue
public MessageQueue getQueue()
Get this engine'sMessageQueueqin.- Specified by:
getQueuein interfaceMessageConsumer- Returns:
- this
Engine's queue.
-
isRunning
public boolean isRunning()
Tests if the engine is alive.- Specified by:
isRunningin interfaceEngineMBean- Specified by:
isRunningin interfaceMessageConsumer- Returns:
- true if this
MessageConsumeris alive; false otherwise.
-
save
public void save() throws IOExceptionSaves logical clock information to persistent storage.- Specified by:
savein interfaceMessageConsumer- Throws:
IOException- an error occurs.
-
restore
public void restore() throws ExceptionRestores logical clock information from persistent storage.- Specified by:
restorein interfaceMessageConsumer- Throws:
Exception- an error occurs.
-
delete
public void delete() throws IllegalStateExceptionThis operation always throws an IllegalStateException.- Specified by:
deletein interfaceMessageConsumer- Throws:
IllegalStateException- an error occurs.- See Also:
Transaction
-
getStamp
private final int getStamp()
Gets the current value of stamp counter.- Returns:
- the current value of stamp counter.
-
stamp
protected final void stamp(Message msg)
Sets the stamp of the given message.- Parameters:
msg- The message to stamp.
-
isPrior
public boolean isPrior(Message m1, Message m2)
Description copied from interface:MessageComparatorCompares the 2 messages for time ordering. Returns true if the first message is earlier than the second, false otherwise.- Specified by:
isPriorin interfaceMessageComparator- Parameters:
m1- The first message.m2- The second message.- Returns:
- true if the first message is earlier than the second, false otherwise.
-
post
public void post(Message msg) throws Exception
Adds a message in "ready to deliver" list. This method allocates a new time stamp to the message ; be Careful, changing the stamp imply the filename change too.- Specified by:
postin interfaceMessageConsumer- Parameters:
msg- the message to deliver.- Throws:
Exception- an error occurs.
-
postAndValidate
public void postAndValidate(Message msg) throws Exception
Posts a message and validates it at the same time.- Specified by:
postAndValidatein interfaceMessageConsumer- Parameters:
msg- the message to deliver.- Throws:
Exception- an error occurs.
-
isAgentProfiling
public boolean isAgentProfiling()
Returns true if the agent profiling is on.- Specified by:
isAgentProfilingin interfaceAgentEngine- Specified by:
isAgentProfilingin interfaceEngineMBean- Returns:
- true if the agent profiling is on.
- See Also:
EngineMBean.isAgentProfiling()
-
setAgentProfiling
public void setAgentProfiling(boolean agentProfiling)
Sets the agent profiling.- Specified by:
setAgentProfilingin interfaceAgentEngine- Specified by:
setAgentProfilingin interfaceEngineMBean- Parameters:
agentProfiling- if true sets the agent profiling.- See Also:
EngineMBean.setAgentProfiling(boolean)
-
getReactTime
public long getReactTime()
Description copied from interface:EngineMBeanReturns the total reaction time calculated for this engine.- Specified by:
getReactTimein interfaceAgentEngine- Specified by:
getReactTimein interfaceEngineMBean- Returns:
- the reactTime
-
resetReactTime
public void resetReactTime()
reset the reactTime- Specified by:
resetReactTimein interfaceEngineMBean
-
getCommitTime
public long getCommitTime()
Description copied from interface:EngineMBeanReturns the total commit time calculated for this engine.- Specified by:
getCommitTimein interfaceAgentEngine- Specified by:
getCommitTimein interfaceEngineMBean- Returns:
- the commitTime
-
resetCommitTime
public void resetCommitTime()
reset the commitTime- Specified by:
resetCommitTimein interfaceEngineMBean
-
resetTimer
public void resetTimer()
Reset reactTime and commitTime- Specified by:
resetTimerin interfaceEngineMBean
-
commit
void commit() throws ExceptionCommit the agent reaction in case of right termination:- suppress the processed notification from message queue, then deletes it ;
- push all new notifications in qin and qout, and saves them ;
- saves the agent state ;
- then commit the transaction to validate all changes.
- Throws:
Exception- an error occurs.
-
abort
void abort(Exception exc) throws Exception
Abort the agent reaction in case of error during execution. In case of unrecoverable error during the reaction we have to rollback:- reload the previous state of agent ;
- remove the failed notification ;
- clean the Channel queue of all pushed notifications ;
- send an error notification to the sender ;
- then commit the transaction to validate all changes.
- Parameters:
exc- the cause.- Throws:
Exception- an error occurs.
-
getWorkInProgress
public final long getWorkInProgress()
Returns the tick counter that reflects activity in engine.- Specified by:
getWorkInProgressin interfaceEngineMBean- Returns:
- the tick counter that reflects activity in engine.
-
incWorkInProgress
public final void incWorkInProgress()
Increments the tick counter that reflects activity in engine.- Specified by:
incWorkInProgressin interfaceAgentEngine- See Also:
workInProgress
-
getAverageCPU
public final int getAverageCPU()
Returns the average use of CPU by the Engine thread during last minute.- Specified by:
getAverageCPUin interfaceEngineMBean- Returns:
- the average use of CPU by the Engine thread during last minute.
-
resetAverageLoad
public final void resetAverageLoad()
- Specified by:
resetAverageLoadin interfaceAgentEngine
-
getAverageLoad1
public final float getAverageLoad1()
Returns the load averages for the last minute.- Specified by:
getAverageLoad1in interfaceAgentEngine- Specified by:
getAverageLoad1in interfaceEngineMBean- Specified by:
getAverageLoad1in interfaceMessageConsumer- Returns:
- the load averages for the last minute.
-
getAverageLoad5
public final float getAverageLoad5()
Returns the load averages for the past 5 minutes.- Specified by:
getAverageLoad5in interfaceAgentEngine- Specified by:
getAverageLoad5in interfaceEngineMBean- Specified by:
getAverageLoad5in interfaceMessageConsumer- Returns:
- the load averages for the past 5 minutes.
-
getAverageLoad15
public final float getAverageLoad15()
Returns the load averages for the past 15 minutes.- Specified by:
getAverageLoad15in interfaceAgentEngine- Specified by:
getAverageLoad15in interfaceEngineMBean- Specified by:
getAverageLoad15in interfaceMessageConsumer- Returns:
- the load averages for the past 15 minutes.
-
report
public String report()
Returns a report about the distribution of messages type in queue.- Specified by:
reportin interfaceEngineMBean- Returns:
- a report about the distribution of messages type in queue.
-
toString
public String toString()
Returns a string representation of this engine.- Specified by:
toStringin interfaceEngineMBean- Overrides:
toStringin classObject- Returns:
- A string representation of this engine.
-
isEngineThread
public boolean isEngineThread()
Checks if the current thread calling this method belongs to the engine.- Specified by:
isEngineThreadin interfaceAgentEngine- Returns:
- true if the current thread calling this method belongs to the engine
-
-