Joram ${version}

org.objectweb.joram.mom.proxies
Class ProxyImpl

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

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

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.
 fr.dyade.aaa.agent.AgentId getId()
           
 int getNbMaxMsg(java.lang.String subName)
          Returns the maximum number of message for identified subscription.
 java.lang.String getStringId()
           
 javax.management.openmbean.CompositeDataSupport getSubscriptionMessage(java.lang.String subName, java.lang.String msgId)
          Returns the description of a particular pending message in a subscription.
 int getSubscriptionMessageCount(java.lang.String subName)
          Returns the number of pending messages for an identified subscription.
 java.lang.String[] getSubscriptionMessageIds(java.lang.String subName)
          Returns the list of message's identifiers for a subscription.
 java.lang.String[] getSubscriptionNames()
          Returns the list of subscriptions for this user.
 java.lang.String getSubscriptionTopicId(java.lang.String subName)
          Returns the unique identifier of the topic related to this subscription.
 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)
           
 void setNbMaxMsg(java.lang.String subName, int nbMaxMsg)
          Sets the maximum number of message for identified subscription.
 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
 

Constructor Detail

ProxyImpl

public ProxyImpl(ProxyAgentItf proxyAgent)
Constructs a ProxyImpl instance.

Method Detail

toString

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

Specified by:
toString in interface ProxyImplMBean

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.

getNbMaxMsg

public int getNbMaxMsg(java.lang.String subName)
Returns the maximum number of message for identified subscription. The subscription is identified by its unique name, if the limit is unset the method returns -1.

Specified by:
getNbMaxMsg in interface ProxyImplMBean
Parameters:
subName - The subscription unique name.
Returns:
the maximum number of message for subscription if set; -1 otherwise.

setNbMaxMsg

public void setNbMaxMsg(java.lang.String subName,
                        int nbMaxMsg)
Sets the maximum number of message for identified subscription. The subscription is identified by its unique name.

Specified by:
setNbMaxMsg in interface ProxyImplMBean
Parameters:
subName - The subscription unique name.
nbMaxMsg - the maximum number of message for subscription (-1 set no limit).

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.

getSubscriptionMessageCount

public int getSubscriptionMessageCount(java.lang.String subName)
Returns the number of pending messages for an identified subscription. The subscription must be identified by its unique 'symbolic' name.

Specified by:
getSubscriptionMessageCount in interface ProxyImplMBean
Parameters:
subName - The subscription unique name.
Returns:
The number of pending message for the subscription.

getSubscriptionTopicId

public java.lang.String getSubscriptionTopicId(java.lang.String subName)
Returns the unique identifier of the topic related to this subscription.

Specified by:
getSubscriptionTopicId in interface ProxyImplMBean
Parameters:
subName - The subscription unique name.
Returns:
the unique identifier of the topic related to this subscription.

getSubscriptionMessageIds

public java.lang.String[] getSubscriptionMessageIds(java.lang.String subName)
Returns the list of message's identifiers for a subscription. The subscription must be identified by its unique 'symbolic' name.

Specified by:
getSubscriptionMessageIds in interface ProxyImplMBean
Parameters:
subName - The subscription unique name.
Returns:
the list of message's identifiers for the subscription.

getSubscriptionMessage

public javax.management.openmbean.CompositeDataSupport getSubscriptionMessage(java.lang.String subName,
                                                                              java.lang.String msgId)
                                                                       throws java.lang.Exception
Returns the description of a particular pending message in a subscription. The subscription is identified by its unique name, the message is pointed out through its unique identifier. The description includes the type and priority of the message.

Specified by:
getSubscriptionMessage in interface ProxyImplMBean
Parameters:
subName - The subscription unique name.
msgId - The unique message's identifier.
Returns:
the description of the message.
Throws:
java.lang.Exception

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.

Specified by:
deleteSubscriptionMessage in interface ProxyImplMBean
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.

getId

public fr.dyade.aaa.agent.AgentId getId()

getStringId

public java.lang.String getStringId()

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

Joram ${version}

Copyright © 2005 Scalagent - All rights reserved