fr.dyade.aaa.jndi2.server

Class Container

Implemented Interfaces:
AgentMBean, BagSerializer, Serializable

public class Container
extends Agent
implements BagSerializer

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(ObjectInputStream in)
void
setBagSerializer(BagSerializer bagSerializer)
void
setLifeCycleListener(LifeCycleListener lifeCycleListener)
void
writeBag(ObjectOutputStream out)

Methods inherited from class fr.dyade.aaa.agent.Agent

agentFinalize, agentInitialize, delete, delete, deploy, deploy, getId, getLogTopic, getName, isDeployed, isFixed, needToBeCommited, react, save, sendTo, sendTo, sendTo, setNoSave, toString

Constructor Details

Container

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

Method Details

addEntryPoint

public void addEntryPoint(EntryPoint entryPoint)


agentFinalize

public 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. 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 interface Agent

Parameters:
lastTime - true when last called by the factory on agent deletion.


agentInitialize

public void agentInitialize(boolean firstTime)
            throws Exception
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 interface Agent

Parameters:
firstTime - true when first called by the factory


react

public void react(AgentId from,
                  Notification not)
            throws Exception
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 interface Agent

Parameters:
from - agent sending notification
not - notification to react to


readBag

public void readBag(ObjectInputStream in)
            throws IOException,
                   ClassNotFoundException
Specified by:
readBag in interface BagSerializer


setBagSerializer

public void setBagSerializer(BagSerializer bagSerializer)


setLifeCycleListener

public void setLifeCycleListener(LifeCycleListener lifeCycleListener)


writeBag

public void writeBag(ObjectOutputStream out)
            throws IOException
Specified by:
writeBag in interface BagSerializer


Copyright B) 2004 Scalagent - All rights reserved