Package fr.dyade.aaa.jndi2.server
Class Container
- java.lang.Object
-
- fr.dyade.aaa.agent.Agent
-
- fr.dyade.aaa.jndi2.server.Container
-
- All Implemented Interfaces:
AgentMBean,Encodable,Serializable
public class Container extends Agent
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private VectorentryPointsprivate LifeCycleListenerlifeCycleListenerprivate static longserialVersionUIDdefine serialVersionUID for interoperability-
Fields inherited from class fr.dyade.aaa.agent.Agent
agentProfiling, DEBUG, emptyString, fixed, logmon
-
Fields inherited from interface fr.dyade.aaa.common.encoding.Encodable
BOOLEAN_ENCODED_SIZE, BYTE_ENCODED_SIZE, DOUBLE_ENCODED_SIZE, FLOAT_ENCODED_SIZE, INT_ENCODED_SIZE, LONG_ENCODED_SIZE, SHORT_ENCODED_SIZE
-
-
Constructor Summary
Constructors Constructor Description Container()This agent cannot be swapped and has a reserved identifier on each agent server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntryPoint(EntryPoint entryPoint)voidagentFinalize(boolean lastTime)Called to inform this agent that it is garbaged and that it should free any active resources that it has allocated.voidagentInitialize(boolean firstTime)Gives this agent an opportunity to initialize after having been deployed, and each time it is loaded into memory.voidreact(AgentId from, Notification not)Defines the reaction of the agent when receiving a notification.(package private) voidsendNotification(AgentId to, Notification not)voidsetLifeCycleListener(LifeCycleListener lifeCycleListener)-
Methods inherited from class fr.dyade.aaa.agent.Agent
agentSave, decode, delete, delete, delete, deploy, deploy, doAdminSyncNotification, encode, getAgentId, getCommitTime, getEncodableClassId, getEncodedSize, getId, getLogTopic, getName, getReactNb, getReactTime, hasName, incWorkInProgress, isAgentProfiling, isDeployed, isFixed, isUpdated, load, needToBeCommited, resetCommitTime, resetReactTime, resetTimer, save, sendTo, sendTo, sendTo, setAgentProfiling, setName, setNoSave, setSave, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
entryPoints
private Vector entryPoints
-
lifeCycleListener
private LifeCycleListener lifeCycleListener
-
-
Method Detail
-
addEntryPoint
public void addEntryPoint(EntryPoint entryPoint)
-
setLifeCycleListener
public void setLifeCycleListener(LifeCycleListener lifeCycleListener)
-
react
public void react(AgentId from, Notification not) throws Exception
Description copied from class:AgentDefines the reaction of the agent when receiving a notification. This member function implements the common reactive behavior of an agent, it is called by the execution engine (see Engine class).If there is no corresponding reaction, the agent send an
UnknownNotificationnotification to the sender.
-
agentInitialize
public void agentInitialize(boolean firstTime) throws ExceptionDescription copied from class:AgentGives this agent an opportunity to initialize after having been deployed, and each time it is loaded into memory.This function is first called by the factory agent, just after it deploys the agent.
This function is used by agents with a
fixedfield set totrueto initialize their transient variables, as it is called each time the agent server is restarted.This function is not declared
finalso that derived classes may change their reload policy. The implementation of this method provided by theAgentclass just registers the JMS MBean.- Overrides:
agentInitializein classAgent- Parameters:
firstTime- true when first called by the factory- Throws:
Exception- unspecialized exception
-
agentFinalize
public void agentFinalize(boolean lastTime)
Description copied from class:AgentCalled to inform this agent that it is garbaged and that it should free any active resources that it has allocated. A subclass ofAgentshould 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 theagentFinalizemethod to stop them.Be careful, the notification sending is not allowed in this method.
The implementation of this method provided by the
Agentclass just unregister the JMX MBean if needed.- Overrides:
agentFinalizein classAgent- Parameters:
lastTime- true when last called by the factory on agent deletion.
-
sendNotification
void sendNotification(AgentId to, Notification not)
-
-