|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.dyade.aaa.agent.Agent
org.objectweb.joram.mom.proxies.UserAgent
public final class UserAgent
Class of a user proxy agent.
Nested Class Summary | |
---|---|
(package private) class |
UserAgent.HeartBeatTask
Timer task responsible for closing the connection if it has not sent any requests for the duration 'timeout'. |
Field Summary | |
---|---|
private WakeUpTask |
cleaningTask
|
private java.util.Hashtable |
connections
Table that contains the user connections: - key = Integer (connection key)
- value =
|
private java.util.Hashtable |
heartBeatTasks
|
private int |
keyCounter
Counter of the connection keys |
static org.objectweb.util.monolog.api.Logger |
logger
logger |
private ProxyImpl |
proxyImpl
All the user requests are delegated to the proxy |
private static long |
serialVersionUID
define serialVersionUID for interoperability |
Fields inherited from class fr.dyade.aaa.agent.Agent |
---|
emptyString, fixed, logmon |
Constructor Summary | |
---|---|
UserAgent()
Creates a new user proxy. |
|
UserAgent(java.lang.String name,
int stamp)
Creates a new user proxy. |
Method Summary | |
---|---|
void |
agentFinalize(boolean lastTime)
Finalizes the agent before it is garbaged. |
void |
agentInitialize(boolean firstTime)
(Re)initializes the agent when (re)loading. |
private void |
doReact(CloseConnectionNot not)
|
private void |
doReact(GetConnectionNot not)
|
private void |
doReact(OpenConnectionNot not)
Registers and starts the UserConnection . |
private void |
doReact(ProxyRequestGroupNot not)
|
private void |
doReact(RequestNot not)
|
private void |
doReact(ResetCollocatedConnectionsNot not)
|
private void |
doReact(ReturnConnectionNot not)
Differs the reply because the connection key counter must be saved before the OpenConnectionNot returns. |
private void |
doReact(SendRepliesNot not)
|
private void |
doReact(SendReplyNot not)
Notification sent by local agents (destinations) indicating that the proxy can reply to a client. |
java.lang.String |
getMBeanName()
|
private void |
init()
|
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 |
setNoSave()
Sets the updated field to false so that the
agent state is not saved after the current reaction; the field is set
back to true for the next reaction. |
private void |
setPeriod(long period)
|
void |
setSave()
Sets the updated field to true so that the
agent state is saved after the current reaction. |
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, delete, deploy, deploy, getAgentId, getCommitTime, getId, getLogTopic, getName, getReactNb, getReactTime, isDeployed, isFixed, needToBeCommited, save, sendTo, sendTo, sendTo, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.objectweb.joram.mom.proxies.ProxyAgentItf |
---|
getId, getName |
Field Detail |
---|
private static final long serialVersionUID
public static org.objectweb.util.monolog.api.Logger logger
private ProxyImpl proxyImpl
private transient java.util.Hashtable connections
Integer
(connection key)
- value =
private transient java.util.Hashtable heartBeatTasks
private int keyCounter
private transient WakeUpTask cleaningTask
Constructor Detail |
---|
public UserAgent()
ConnectionManager
public UserAgent(java.lang.String name, int stamp)
ConnectionManager
Method Detail |
---|
private void init()
public void agentInitialize(boolean firstTime) throws java.lang.Exception
agentInitialize
in class Agent
firstTime
- true when first called by the factory
java.lang.Exception
- unspecialized exceptionpublic void agentFinalize(boolean lastTime)
agentFinalize
in class Agent
lastTime
- true when last called by the factory on agent deletion.public java.lang.String getMBeanName()
getMBeanName
in interface ProxyAgentItf
public void react(AgentId from, Notification not) throws java.lang.Exception
Agent
class react
method for
providing the JMS client proxy with its specific behaviour.
A JMS proxy specifically reacts to the following notifications:
OpenConnectionNot
react
in class Agent
from
- agent sending notificationnot
- notification to react to
java.lang.Exception
- unspecialized exceptionprivate void setPeriod(long period)
private void doReact(OpenConnectionNot not)
UserConnection
.
private void doReact(ReturnConnectionNot not)
private void doReact(GetConnectionNot not)
private void doReact(RequestNot not)
private void doReact(ProxyRequestGroupNot not)
private void doReact(CloseConnectionNot not)
private void doReact(ResetCollocatedConnectionsNot not)
private void doReact(SendRepliesNot not)
private void doReact(SendReplyNot not)
not
- public void sendNot(AgentId to, Notification not)
sendNot
in interface ProxyAgentItf
to
- the identifier of the recipient agentnot
- the notification to sendpublic void sendToClient(int key, AbstractJmsReply reply)
sendToClient
in interface ProxyAgentItf
key
- the key of the connection the client
is connected through.reply
- the reply to send to the client.public void setNoSave()
Agent
updated
field to false
so that the
agent state is not saved after the current reaction; the field is set
back to true
for the next reaction.
setNoSave
in interface ProxyAgentItf
setNoSave
in class Agent
public void setSave()
Agent
updated
field to true
so that the
agent state is saved after the current reaction.
setSave
in interface ProxyAgentItf
setSave
in class Agent
public void readBag(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
BagSerializer
readBag
in interface BagSerializer
java.io.IOException
java.lang.ClassNotFoundException
public void writeBag(java.io.ObjectOutputStream out) throws java.io.IOException
BagSerializer
writeBag
in interface BagSerializer
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |