|
||||||||||
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
The UserAgent
class implements the MOM proxy behaviour,
basically forwarding client requests to MOM destinations and MOM
destinations replies to clients.
Field Summary | |
---|---|
static org.objectweb.util.monolog.api.Logger |
logger
|
Fields inherited from class fr.dyade.aaa.agent.Agent |
---|
emptyString, fixed, logmon |
Constructor Summary | |
---|---|
UserAgent()
Constructs a UserAgent instance. |
|
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. |
protected void |
cleanPendingMessages(long currentTime)
|
void |
delete()
Permits this agent to destroy itself. |
void |
deleteSubscriptionMessage(java.lang.String subName,
java.lang.String msgId)
Deletes a particular pending message in a subscription. |
protected org.objectweb.joram.mom.proxies.ClientContext |
getClientContext(int ctxId)
|
java.lang.String |
getDMQId()
Returns the default DMQ for subscription of this user. |
protected java.lang.String |
getMsgTxname()
|
int |
getNbMaxMsg()
Returns the default maximum number of message for the subscription of this user. |
long |
getNbMsgsSentToDMQSinceCreation()
Returns the number of erroneous messages forwarded to the DMQ since creation time of this proxy.. |
long |
getPeriod()
Returns the period value of this queue, -1 if not set. |
java.lang.String[] |
getSubscriptionNames()
Returns the list of subscriptions for this user. |
int |
getThreshold()
Returns the default threshold for the subscription of this user. 0 stands for no threshold, -1 for value not set. |
void |
react(AgentId from,
Notification not)
Overrides the Agent class react method for
providing the JMS client proxy with its specific behaviour. |
protected void |
reactToClientRequest(int key,
AbstractJmsRequest request)
Method processing clients requests. |
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 |
setInterceptors(java.util.Properties prop)
Only call in UserAgent creation. |
protected void |
setMsgTxName(Message msg)
|
void |
setNbMaxMsg(int nbMaxMsg)
Sets the maximum number of message for the subscription of this user. |
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. |
void |
setPeriod(long period)
Sets or unsets the period for this queue. |
void |
setSave()
Sets the updated field to true so that the
agent state is saved after the current reaction. |
void |
setThreshold(int threshold)
Sets the default threshold for the subscription of this user. 0 stands for no threshold, -1 for value not set. |
java.lang.String |
toString()
Returns a string representation of this user's proxy. |
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, deploy, deploy, getAgentId, getCommitTime, getId, getLogTopic, getName, getReactNb, getReactTime, isDeployed, isFixed, needToBeCommited, save, sendTo, sendTo, sendTo, setName |
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.UserAgentMBean |
---|
getName |
Methods inherited from interface fr.dyade.aaa.agent.AgentMBean |
---|
getAgentId, getCommitTime, getReactNb, getReactTime, isFixed |
Methods inherited from interface org.objectweb.joram.mom.proxies.ProxyAgentItf |
---|
getId |
Field Detail |
---|
public static org.objectweb.util.monolog.api.Logger logger
Constructor Detail |
---|
public UserAgent()
UserAgent
instance.
public UserAgent(java.lang.String name, int stamp)
ConnectionManager
Method Detail |
---|
public long getPeriod()
getPeriod
in interface UserAgentMBean
public void setPeriod(long period)
setPeriod
in interface UserAgentMBean
period
- The period value to be set or -1 for unsetting previous
value.public java.lang.String getDMQId()
getDMQId
in interface UserAgentMBean
public int getThreshold()
getThreshold
in interface UserAgentMBean
public void setThreshold(int threshold)
setThreshold
in interface UserAgentMBean
threshold
- the threshold to set.public int getNbMaxMsg()
getNbMaxMsg
in interface UserAgentMBean
public void setNbMaxMsg(int nbMaxMsg)
setNbMaxMsg
in interface UserAgentMBean
nbMaxMsg
- the maximum number of message (-1 set no limit).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 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 exceptionpublic 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)
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 java.lang.String toString()
toString
in interface AgentMBean
toString
in interface UserAgentMBean
toString
in class Agent
public void setInterceptors(java.util.Properties prop)
prop
- propertiesprotected void reactToClientRequest(int key, AbstractJmsRequest request)
Some of the client requests are directly forwarded, some others are sent to the proxy so that their processing occurs in a transaction.
A MomExceptionReply
wrapping a DestinationException
might be sent back if a target destination can't be identified.
protected final java.lang.String getMsgTxname()
protected final void setMsgTxName(Message msg)
public java.lang.String[] getSubscriptionNames()
getSubscriptionNames
in interface UserAgentMBean
public void deleteSubscriptionMessage(java.lang.String subName, java.lang.String msgId)
subName
- The subscription unique name.msgId
- The unique message's identifier.protected org.objectweb.joram.mom.proxies.ClientContext getClientContext(int ctxId)
protected void cleanPendingMessages(long currentTime)
public void delete()
Agent
delete
in interface AgentMBean
delete
in interface UserAgentMBean
delete
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
public long getNbMsgsSentToDMQSinceCreation()
UserAgentMBean
getNbMsgsSentToDMQSinceCreation
in interface UserAgentMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |