org.objectweb.joram.mom.proxies
Class UserAgent

java.lang.Object
  extended byfr.dyade.aaa.agent.Agent
      extended byorg.objectweb.joram.mom.proxies.UserAgent
All Implemented Interfaces:
AgentMBean, BagSerializer, ProxyAgentItf, java.io.Serializable

public class UserAgent
extends Agent
implements BagSerializer, ProxyAgentItf

Class of a user proxy agent.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class fr.dyade.aaa.agent.Agent
fixed, logmon, name
 
Constructor Summary
UserAgent()
          Creates a new user proxy.
UserAgent(int stamp)
          Creates a new user proxy.
 
Method Summary
 void agentInitialize(boolean firstTime)
          (Re)initializes the agent when (re)loading.
 AgentId getAgentId()
          Returns the agent identifier of this agent.
 void react(AgentId from, Notification not)
          Overrides the Agent class react method for providing the JMS client proxy with its specific behaviour.
 void readBag(java.io.ObjectInputStream in)
          The readBag method is responsible for reading from the stream and restoring the agent's transient state.
 void sendNot(AgentId to, Notification not)
          Sends a notification to the specified agent.
 void sendToClient(int key, AbstractJmsReply reply)
          Sends a reply to the client connected through the specified connection.
 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
agentFinalize, 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

UserAgent

public UserAgent()
Creates a new user proxy.

See Also:
AdminTopicImpl, ConnectionManager

UserAgent

public UserAgent(int stamp)
Creates a new user proxy.

See Also:
AdminTopicImpl, ConnectionManager
Method Detail

agentInitialize

public void agentInitialize(boolean firstTime)
                     throws java.lang.Exception
(Re)initializes the agent when (re)loading.

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
Overrides the Agent class react method for providing the JMS client proxy with its specific behaviour.

A JMS proxy specifically reacts to the following notifications:

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

getAgentId

public AgentId getAgentId()
Returns the agent identifier of this agent.

Specified by:
getAgentId in interface ProxyAgentItf

sendNot

public void sendNot(AgentId to,
                    Notification not)
Sends a notification to the specified agent.

Specified by:
sendNot in interface ProxyAgentItf
Parameters:
to - the identifier of the recipient agent
not - the notification to send

sendToClient

public void sendToClient(int key,
                         AbstractJmsReply reply)
Sends a reply to the client connected through the specified connection.

Specified by:
sendToClient in interface ProxyAgentItf
Parameters:
key - the key of the connection the client is connected through.
reply - the reply to send to the client.

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

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


Copyright ? 2004 Scalagent - All rights reserved