fr.dyade.aaa.jndi2.server
Class Container

java.lang.Object
  extended byfr.dyade.aaa.agent.Agent
      extended byfr.dyade.aaa.jndi2.server.Container
All Implemented Interfaces:
AgentMBean, BagSerializer, java.io.Serializable

public class Container
extends Agent
implements BagSerializer

See Also:
Serialized Form

Field Summary
 
Fields inherited from class fr.dyade.aaa.agent.Agent
fixed, logmon, name
 
Constructor Summary
Container()
          This agent cannot be swapped and has a reserved identifier on each agent server.
 
Method Summary
 void addEntryPoint(EntryPoint entryPoint)
           
 void agentFinalize(boolean lastTime)
          Called to inform this agent that it is garbaged and that it should free any active ressources 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.
 void readBag(java.io.ObjectInputStream in)
          The readBag method is responsible for reading from the stream and restoring the agent's transient state.
 void setBagSerializer(BagSerializer bagSerializer)
           
 void setLifeCycleListener(LifeCycleListener lifeCycleListener)
           
 void writeBag(java.io.ObjectOutputStream out)
          The writeBag method is responsible for writing the extra data of this particular agent so that the corresponding readBag method can restore it.
 
Methods inherited from class fr.dyade.aaa.agent.Agent
delete, delete, deploy, deploy, getId, getLogTopic, getName, isDeployed, isFixed, needToBeCommited, save, sendTo, sendTo, sendTo, setNoSave, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Container

public Container()
This agent cannot be swapped and has a reserved identifier on each agent server.

Method Detail

addEntryPoint

public void addEntryPoint(EntryPoint entryPoint)

setLifeCycleListener

public void setLifeCycleListener(LifeCycleListener lifeCycleListener)

setBagSerializer

public void setBagSerializer(BagSerializer bagSerializer)

react

public void react(AgentId from,
                  Notification not)
           throws java.lang.Exception
Description copied from class: Agent
Defines 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 UnknownNotification notification to the sender.

Overrides:
react in class Agent
Parameters:
from - agent sending notification
not - notification to react to
Throws:
java.lang.Exception - unspecialized exception

agentInitialize

public void agentInitialize(boolean firstTime)
                     throws java.lang.Exception
Description copied from class: Agent
Gives 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 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 does nothing.

Overrides:
agentInitialize in class Agent
Parameters:
firstTime - true when first called by the factory
Throws:
java.lang.Exception - unspecialized exception

agentFinalize

public void agentFinalize(boolean lastTime)
Description copied from class: Agent
Called to inform this agent that it is garbaged and that it should free any active ressources that it has allocated. A subclass of 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. The implementation of this method provided by the Agent class does nothing.

Overrides:
agentFinalize in class Agent
Parameters:
lastTime - true when last called by the factory on agent deletion.

writeBag

public void writeBag(java.io.ObjectOutputStream out)
              throws java.io.IOException
Description copied from interface: BagSerializer
The writeBag method is responsible for writing the extra data of this particular agent so that the corresponding readBag method can restore it.

Specified by:
writeBag in interface BagSerializer
Throws:
java.io.IOException

readBag

public void readBag(java.io.ObjectInputStream in)
             throws java.io.IOException,
                    java.lang.ClassNotFoundException
Description copied from interface: BagSerializer
The readBag method is responsible for reading from the stream and restoring the agent's transient state.

Specified by:
readBag in interface BagSerializer
Throws:
java.io.IOException
java.lang.ClassNotFoundException


Copyright ? 2004 Scalagent - All rights reserved