public class Container extends Agent
Modifier and Type | Field and Description |
---|---|
private Vector |
entryPoints |
private LifeCycleListener |
lifeCycleListener |
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
agentProfiling, emptyString, fixed, logmon
BOOLEAN_ENCODED_SIZE, BYTE_ENCODED_SIZE, DOUBLE_ENCODED_SIZE, FLOAT_ENCODED_SIZE, INT_ENCODED_SIZE, LONG_ENCODED_SIZE, SHORT_ENCODED_SIZE
Constructor and Description |
---|
Container()
This agent cannot be swapped and has
a reserved identifier on each agent server.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntryPoint(EntryPoint entryPoint) |
void |
agentFinalize(boolean lastTime)
Called to inform this agent that it is garbaged and that it should free
any active resources that it has allocated.
|
void |
agentInitialize(boolean firstTime)
Gives this agent an opportunity to initialize after having been deployed,
and each time it is loaded into memory.
|
void |
react(AgentId from,
Notification not)
Defines the reaction of the agent when receiving a notification.
|
(package private) void |
sendNotification(AgentId to,
Notification not) |
void |
setLifeCycleListener(LifeCycleListener lifeCycleListener) |
agentSave, decode, delete, delete, delete, deploy, deploy, encode, getAgentId, getCommitTime, getEncodableClassId, getEncodedSize, getId, getLogTopic, getName, getReactNb, getReactTime, hasName, isAgentProfiling, isDeployed, isFixed, isUpdated, needToBeCommited, resetCommitTime, resetReactTime, resetTimer, save, sendTo, sendTo, sendTo, setAgentProfiling, setName, setNoSave, setSave, toString
private static final long serialVersionUID
private Vector entryPoints
private LifeCycleListener lifeCycleListener
public Container()
public void addEntryPoint(EntryPoint entryPoint)
public void setLifeCycleListener(LifeCycleListener lifeCycleListener)
public void react(AgentId from, Notification not) throws Exception
Agent
If there is no corresponding reaction, the agent send an
UnknownNotification
notification to the sender.
public void agentInitialize(boolean firstTime) throws Exception
Agent
This function is first called by the factory agent, just after it deploys the agent.
This function is used by agents with a fixed
field set to
true
to initialize their transient variables, as it is called
each time the agent server is restarted.
This function is not declared final
so that derived classes
may change their reload policy. The implementation of this method provided
by the Agent
class just registers the JMS MBean.
agentInitialize
in class Agent
firstTime
- true when first called by the factoryException
- unspecialized exceptionpublic void agentFinalize(boolean lastTime)
Agent
Agent
should override this method if it has
any operation that it wants to perform before it is garbaged. For example,
an agent with threads (a ProxyAgent for example) would use the initialize
method to create the threads and the agentFinalize
method to
stop them.
Be careful, the notification sending is not allowed in this method.
The implementation of this method provided by the Agent
class
just unregister the JMX MBean if needed.
agentFinalize
in class Agent
lastTime
- true when last called by the factory on agent deletion.void sendNotification(AgentId to, Notification not)
Copyright © 2020 ScalAgent D.T.. All rights reserved.