fr.dyade.aaa.agent
Class AgentFactory

java.lang.Object
  extended by fr.dyade.aaa.agent.Agent
      extended by fr.dyade.aaa.agent.AgentFactory
All Implemented Interfaces:
AgentMBean, java.io.Serializable

final class AgentFactory
extends Agent

Agent used to allow remote agent creation. Every agent server hosts a factory agent, they all use a predefined stamp identifier AgentId.factoryId. The factory must be able to create all types of objects, actually it is supposed that the corresponding classes can be reached.

The agent creation process involves the following steps

The AgentDeleteRequest class of notification follows a similar process to remotely delete agents.


Field Summary
private static long serialVersionUID
          define serialVersionUID for interoperability
 
Fields inherited from class fr.dyade.aaa.agent.Agent
commitTime, deployed, emptyString, fixed, id, last, logmon, name, reactNb, reactTime
 
Constructor Summary
AgentFactory(AgentId factoryId)
          Allocates a new AgentFactory agent.
 
Method Summary
protected  void agentInitialize(boolean firstTime)
          Gives this agent an opportunity to initialize after having been deployed, and each time it is loaded into memory.
protected  java.lang.String getLogTopic()
          Returns log topic for factory agent.
 void react(AgentId from, Notification not)
          Reacts to notifications ... .
 
Methods inherited from class fr.dyade.aaa.agent.Agent
agentFinalize, delete, delete, delete, deploy, deploy, getAgentId, getCommitTime, getId, getName, getReactNb, getReactTime, isDeployed, isFixed, load, needToBeCommited, save, sendTo, sendTo, sendTo, setName, setNoSave, setSave, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
define serialVersionUID for interoperability

See Also:
Constant Field Values
Constructor Detail

AgentFactory

AgentFactory(AgentId factoryId)
Allocates a new AgentFactory agent. An AgentFactory agent must be created on every agent server the first time it runs.

Method Detail

getLogTopic

protected java.lang.String getLogTopic()
Returns log topic for factory agent.

Overrides:
getLogTopic in class Agent

agentInitialize

protected void agentInitialize(boolean firstTime)
                        throws java.lang.Exception
Gives this agent an opportunity to initialize after having been deployed, and each time it is loaded into memory. Loads the list of agents with a fixed field set to true.

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

react

public void react(AgentId from,
                  Notification not)
           throws java.lang.Exception
Reacts to notifications ... .

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


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.