org.objectweb.joram.mom.proxies

Class UserAgent

Implemented Interfaces:
AgentMBean, BagSerializer, ProxyAgentItf, Serializable

public class UserAgent
extends Agent
implements BagSerializer, ProxyAgentItf

Class of a user proxy agent.

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(ObjectInputStream in)
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(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

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 Details

agentInitialize

public void agentInitialize(boolean firstTime)
            throws Exception
(Re)initializes the agent when (re)loading.
Overrides:
agentInitialize in interface Agent


getAgentId

public AgentId getAgentId()
Returns the agent identifier of this agent.
Specified by:
getAgentId in interface ProxyAgentItf


react

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

  • OpenConnectionNot
Overrides:
react in interface Agent


readBag

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


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.


writeBag

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


Copyright B) 2004 Scalagent - All rights reserved