Joram 5.0.9

org.objectweb.joram.mom.proxies
Class ProxyImpl

java.lang.Object
  extended by org.objectweb.joram.mom.proxies.ProxyImpl
All Implemented Interfaces:
java.io.Serializable, ProxyImplMBean

public class ProxyImpl
extends java.lang.Object
implements java.io.Serializable, ProxyImplMBean

The ProxyImpl class implements the MOM proxy behaviour, basically forwarding client requests to MOM destinations and MOM destinations replies to clients.

See Also:
Serialized Form

Field Summary
static org.objectweb.util.monolog.api.Logger logger
           
protected  long nbMsgsSentToDMQSinceCreation
          the number of erroneous messages forwarded to the DMQ
protected  long period
          period to run the cleaning task, by default 60s.
 
Constructor Summary
ProxyImpl(ProxyAgentItf proxyAgent)
          Constructs a ProxyImpl instance.
 
Method Summary
 void deleteProxy(fr.dyade.aaa.agent.AgentId from)
          This method deletes the proxy by notifying its connected clients, denying the non acknowledged messages, deleting the temporary destinations, removing the subscriptions.
 void deleteSubscriptionMessage(java.lang.String subName, java.lang.String msgId)
          Deletes a particular pending message in a subscription.
protected  void doReact(fr.dyade.aaa.agent.AgentId from, Monit_GetNbMaxMsg not)
          Method implementing the reaction to a Monit_GetNbMaxMsg notification requesting the number max of messages in the subscription.
protected  void doReact(fr.dyade.aaa.agent.AgentId from, SetNbMaxMsgRequest not)
          Method implementing the reaction to a SetNbMaxMsgRequest instance setting the NbMaxMsg value for the subscription.
protected  java.lang.String getMsgTxname()
           
 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.
 void initialize(boolean firstTime)
          (Re)initializes the proxy.
 void react(fr.dyade.aaa.agent.AgentId from, fr.dyade.aaa.agent.Notification not)
          Distributes the received notifications to the appropriate reactions.
 void reactToClientRequest(int key, AbstractJmsRequest request)
          Method processing clients requests.
 void readBag(java.io.ObjectInputStream in)
           
protected  void setMsgTxName(Message msg)
           
 void setPeriod(long period)
          Sets or unsets the period for this queue.
 java.lang.String toString()
          Returns a string representation of this user's proxy.
 void writeBag(java.io.ObjectOutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static org.objectweb.util.monolog.api.Logger logger

period

protected long period
period to run the cleaning task, by default 60s.


nbMsgsSentToDMQSinceCreation

protected long nbMsgsSentToDMQSinceCreation
the number of erroneous messages forwarded to the DMQ

Constructor Detail

ProxyImpl

public ProxyImpl(ProxyAgentItf proxyAgent)
Constructs a ProxyImpl instance.

Method Detail

getPeriod

public long getPeriod()
Returns the period value of this queue, -1 if not set.

Specified by:
getPeriod in interface ProxyImplMBean
Returns:
the period value of this queue; -1 if not set.

setPeriod

public void setPeriod(long period)
Sets or unsets the period for this queue.

Specified by:
setPeriod in interface ProxyImplMBean
Parameters:
period - The period value to be set or -1 for unsetting previous value.

toString

public java.lang.String toString()
Returns a string representation of this user's proxy.

Specified by:
toString in interface ProxyImplMBean
Overrides:
toString in class java.lang.Object

initialize

public void initialize(boolean firstTime)
                throws java.lang.Exception
(Re)initializes the proxy.

Throws:
java.lang.Exception - If the proxy state could not be fully retrieved, leading to an inconsistent state.

reactToClientRequest

public void reactToClientRequest(int key,
                                 AbstractJmsRequest request)
Method processing clients requests.

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.


react

public void react(fr.dyade.aaa.agent.AgentId from,
                  fr.dyade.aaa.agent.Notification not)
           throws fr.dyade.aaa.agent.UnknownNotificationException
Distributes the received notifications to the appropriate reactions.

A JMS proxy reacts to:

Throws:
fr.dyade.aaa.agent.UnknownNotificationException - If the notification is not expected.

doReact

protected void doReact(fr.dyade.aaa.agent.AgentId from,
                       SetNbMaxMsgRequest not)
Method implementing the reaction to a SetNbMaxMsgRequest instance setting the NbMaxMsg value for the subscription.


doReact

protected void doReact(fr.dyade.aaa.agent.AgentId from,
                       Monit_GetNbMaxMsg not)
Method implementing the reaction to a Monit_GetNbMaxMsg notification requesting the number max of messages in the subscription.

Throws:
AccessException - If the requester is not the administrator.

getMsgTxname

protected final java.lang.String getMsgTxname()

setMsgTxName

protected final void setMsgTxName(Message msg)

getSubscriptionNames

public java.lang.String[] getSubscriptionNames()
Returns the list of subscriptions for this user. Each subscription is identified by its unique 'symbolic' name.

Specified by:
getSubscriptionNames in interface ProxyImplMBean
Returns:
The list of subscriptions for this user.

deleteSubscriptionMessage

public void deleteSubscriptionMessage(java.lang.String subName,
                                      java.lang.String msgId)
Deletes a particular pending message in a subscription. The subscription is identified by its unique name, the message is pointed out through its unique identifier.

Parameters:
subName - The subscription unique name.
msgId - The unique message's identifier.

deleteProxy

public void deleteProxy(fr.dyade.aaa.agent.AgentId from)
                 throws java.lang.Exception
This method deletes the proxy by notifying its connected clients, denying the non acknowledged messages, deleting the temporary destinations, removing the subscriptions.

Throws:
java.lang.Exception - If the requester is not an administrator.

readBag

public void readBag(java.io.ObjectInputStream in)
             throws java.io.IOException,
                    java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeBag

public void writeBag(java.io.ObjectOutputStream out)
              throws java.io.IOException
Throws:
java.io.IOException

getNbMsgsSentToDMQSinceCreation

public long getNbMsgsSentToDMQSinceCreation()
Description copied from interface: ProxyImplMBean
Returns the number of erroneous messages forwarded to the DMQ since creation time of this proxy..

Specified by:
getNbMsgsSentToDMQSinceCreation in interface ProxyImplMBean
Returns:
the number of erroneous messages forwarded to the DMQ.

Joram 5.0.9

Copyright © 2005 Scalagent - All rights reserved