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

Constructor Summary
ProxyImpl(ProxyAgentItf proxyAgent)
          Constructs a ProxyImpl instance.
 
Method Summary
 void deleteProxy(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)
           
 AgentId getId()
           
 javax.management.openmbean.CompositeDataSupport getSubscriptionMessage(java.lang.String subName, java.lang.String msgId)
           
 int getSubscriptionMessageCount(java.lang.String subName)
           
 java.lang.String[] getSubscriptionMessageIds(java.lang.String subName)
           
 java.lang.String[] getSubscriptionNames()
           
 java.lang.String getSubscriptionTopicId(java.lang.String subName)
           
 void initialize(boolean firstTime)
          (Re)initializes the proxy.
 void react(AgentId from, 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)
           
 java.lang.String toString()
           
 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()
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(AgentId from,
                  Notification not)
           throws UnknownNotificationException
Distributes the received notifications to the appropriate reactions.

A JMS proxy reacts to:

Throws:
UnknownNotificationException - If the notification is not expected.

getSubscriptionNames

public java.lang.String[] getSubscriptionNames()
Specified by:
getSubscriptionNames in interface ProxyImplMBean

getSubscriptionMessageCount

public int getSubscriptionMessageCount(java.lang.String subName)
Specified by:
getSubscriptionMessageCount in interface ProxyImplMBean

getSubscriptionTopicId

public java.lang.String getSubscriptionTopicId(java.lang.String subName)
Specified by:
getSubscriptionTopicId in interface ProxyImplMBean

getSubscriptionMessageIds

public java.lang.String[] getSubscriptionMessageIds(java.lang.String subName)

getSubscriptionMessage

public javax.management.openmbean.CompositeDataSupport getSubscriptionMessage(java.lang.String subName,
                                                                              java.lang.String msgId)
                                                                       throws java.lang.Exception
Specified by:
getSubscriptionMessage in interface ProxyImplMBean
Throws:
java.lang.Exception

deleteSubscriptionMessage

public void deleteSubscriptionMessage(java.lang.String subName,
                                      java.lang.String msgId)
Specified by:
deleteSubscriptionMessage in interface ProxyImplMBean

deleteProxy

public void deleteProxy(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 AgentId getId()

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


Copyright © 2004 Scalagent - All rights reserved