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 final 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
private  ClientContext activeCtx
          Reference to the active ClientContext instance.
private  int activeCtxId
          Identifier of the active context.
private  long arrivalsCounter
          Counter of message arrivals from topics.
private  java.util.Map contexts
          Table of the proxy's ClientContext instances.
private  AgentId dmqId
          Identifier of this proxy dead message queue, null for DMQ not set.
static org.objectweb.util.monolog.api.Logger logger
           
private  java.util.Map messagesTable
          Table holding the subscriptions' messages.
(package private)  java.lang.String msgTxname
           
protected  int nbMaxMsg
          Maximum number of Message store in subscriptions (-1 set no limit).
protected  long nbMsgsSentToDMQSinceCreation
          the number of erroneous messages forwarded to the DMQ
protected  long period
          period to run the cleaning task, by default 60s.
private  ProxyAgentItf proxyAgent
          The reference of the agent hosting the proxy.
private  java.util.Map recoveredTransactions
          Table holding the recovered transactions branches.
private static long serialVersionUID
          define serialVersionUID for interoperability
private  java.util.Map subsTable
          Table holding the ClientSubscription instances.
private  int threshold
          Threshold above which messages are considered as undeliverable because constantly denied.
private  java.util.Map topicsTable
          Table holding the TopicSubscription instances.
 
Constructor Summary
ProxyImpl(ProxyAgentItf proxyAgent)
          Constructs a ProxyImpl instance.
 
Method Summary
(package private)  void cleanPendingMessages(long currentTime)
           
 void delete()
          Deletes this proxy.
private  void deleteProxy(FwdAdminRequestNot not)
          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.
private  void deleteTemporaryDestination(AgentId destId)
           
private  void doFwd(AgentId from, AbstractReplyNot rep)
          Distributes the JMS replies to the appropriate reactions.
private  void doFwd(AgentId from, QueueMsgReply rep)
          Actually forwards a QueueMsgReply coming from a destination as a ConsumerMessages destinated to the requesting client.
private  void doFwd(AgentId from, TopicMsgsReply rep)
          Method implementing the proxy reaction to a TopicMsgsReply holding messages published by a topic.
private  void doFwd(BrowseReply rep)
          Actually forwards a BrowseReply coming from a destination as a QBrowseReply destinated to the requesting client.
private  void doFwd(SubscribeReply rep)
          Forwards the topic's SubscribeReply as a ServerReply.
private  void doReact(AdminReplyNot reply)
          An AdminReply acknowledges the setting of a temporary destination; nothing needs to be done.
private  void doReact(AgentId from, ExceptionReply rep)
          Actually forwards an ExceptionReply coming from a destination as a MomExceptionReply destinated to the requesting client.
private  void doReact(ClearSubscription request, AgentId replyTo, java.lang.String requestMsgId, java.lang.String replyMsgId)
           
private  void doReact(CnxStartRequest req)
          Method implementing the proxy reaction to a CnxStartRequest requesting to start a context.
private  void doReact(CnxStopRequest req)
          Method implementing the JMS proxy reaction to a CnxStopRequest requesting to stop a context.
private  void doReact(ConsumerAckRequest req)
          Method implementing the JMS proxy reaction to a ConsumerAckRequest acknowledging a message either on a queue or on a subscription.
private  void doReact(ConsumerCloseSubRequest req)
          Method implementing the JMS proxy reaction to a ConsumerCloseSubRequest requesting to deactivate a durable subscription.
private  void doReact(ConsumerDenyRequest req)
          Method implementing the JMS proxy reaction to a ConsumerDenyRequest denying a message either on a queue or on a subscription.
private  void doReact(ConsumerReceiveRequest req)
          Method implementing the proxy reaction to a ConsumerReceiveRequest instance, requesting a message from a subscription.
private  void doReact(ConsumerSetListRequest req)
          Method implementing the JMS proxy reaction to a ConsumerSetListRequest notifying the creation of a client listener.
private  void doReact(ConsumerSubRequest req)
          Method implementing the JMS proxy reaction to a ConsumerSubRequest requesting to subscribe to a topic.
private  void doReact(ConsumerUnsetListRequest req)
          Method implementing the JMS proxy reaction to a ConsumerUnsetListRequest notifying that a consumer listener is unset.
private  void doReact(ConsumerUnsubRequest req)
          Method implementing the JMS proxy reaction to a ConsumerUnsubRequest requesting to remove a subscription.
private  void doReact(DeleteSubscriptionMessage request, AgentId replyTo, java.lang.String requestMsgId, java.lang.String replyMsgId)
           
private  void doReact(FwdAdminRequestNot not)
           
private  void doReact(GetSubscription request, AgentId replyTo, java.lang.String requestMsgId, java.lang.String replyMsgId)
           
private  void doReact(GetSubscriptionMessage request, AgentId replyTo, java.lang.String requestMsgId, java.lang.String replyMsgId)
           
private  void doReact(GetSubscriptionMessageIds request, AgentId replyTo, java.lang.String requestMsgId, java.lang.String replyMsgId)
           
private  void doReact(GetSubscriptions request, AgentId replyTo, java.lang.String requestMsgId, java.lang.String replyMsgId)
           
private  void doReact(int key, AbstractJmsRequest request)
          Distributes the client requests to the appropriate reactions.
private  void doReact(int key, ActivateConsumerRequest req)
           
private  void doReact(int key, CnxCloseRequest req)
          The method closes a given context by denying the non acknowledged messages delivered to this context, and deleting its temporary subscriptions and destinations.
private  void doReact(int key, CnxConnectRequest req)
          Method implementing the reaction to a CnxConnectRequest requesting the key of the active context.
private  void doReact(int key, CommitRequest req)
           
private  void doReact(int key, GetAdminTopicRequest req)
          Method implementing the reaction to a GetAdminTopicRequest requesting the identifier of the local admin topic.
private  void doReact(SessAckRequest req)
          Method implementing the JMS proxy reaction to a SessAckRequest acknowledging messages either on a queue or on a subscription.
private  void doReact(SessCreateDestRequest req)
          Method implementing the JMS proxy reaction to a SessCreateDestRequest requesting the creation of a destination.
private  void doReact(SessDenyRequest req)
          Method implementing the JMS proxy reaction to a SessDenyRequest denying messages either on a queue or on a subscription.
private  void doReact(SyncReply not)
          Method implementing the JMS proxy reaction to a SyncReply notification sent by itself, wrapping a reply to be sent to a client.
private  void doReact(TempDestDeleteRequest req)
          Method implementing the JMS proxy reaction to a TempDestDeleteRequest request for deleting a temporary destination.
private  void doReact(UnknownAgent uA)
          Method implementing the JMS proxy reaction to an UnknownAgent notification notifying that a destination does not exist or is deleted.
private  void doReact(XACnxCommit req)
          Method implementing the JMS proxy reaction to an XACnxCommit request committing the operations performed in a given transaction.
private  void doReact(XACnxPrepare req)
          Method implementing the JMS proxy reaction to an XACnxPrepare request holding messages and acknowledgements produced in an XA transaction.
private  void doReact(XACnxRecoverRequest req)
          Reacts to a XACnxRecoverRequest request requesting the identifiers of the prepared transactions.
private  void doReact(XACnxRollback req)
          Method implementing the JMS proxy reaction to an XACnxRollback request rolling back the operations performed in a given transaction.
private  void doReply(AbstractJmsReply reply)
          Method used for sending an AbstractJmsReply back to an external client within the active context.
private  void doReply(int key, AbstractJmsReply reply)
          Method used for sending an AbstractJmsReply back to an external client through a given context.
(package private)  ClientContext getClientContext(int ctxId)
           
 java.lang.String getDMQId()
          Returns the default DMQ for subscription of this user.
private  java.lang.String getMBeanName(java.lang.String name)
           
protected  java.lang.String getMsgTxname()
           
 java.lang.String getName()
          Returns the name of this queue, or its id if not set.
 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 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.
private  void reactToClientRequest(int key, ConsumerReceiveRequest req)
          Either forwards the ConsumerReceiveRequest request as a ReceiveRequest directly to the target queue, or wraps it and sends it to the proxy if destinated to a subscription.
private  void reactToClientRequest(int key, ConsumerSetListRequest req)
          Either forwards the ConsumerSetListRequest request as a ReceiveRequest directly to the target queue, or wraps it and sends it to the proxy if destinated to a subscription.
private  void reactToClientRequest(int key, JmsRequestGroup request)
           
private  void reactToClientRequest(int key, ProducerMessages req)
          Forwards the messages sent by the client in a ProducerMessages request as a ClientMessages MOM request directly to a destination, and acknowledges them by sending a ServerReply back.
private  void reactToClientRequest(int key, QBrowseRequest req)
          Forwards the client's QBrowseRequest request as a BrowseRequest MOM request directly to a destination.
 void readBag(java.io.ObjectInputStream in)
           
private  void replyToTopic(AdminReply reply, AgentId replyTo, java.lang.String requestMsgId, java.lang.String replyMsgId)
           
private  void setActiveCtxId(int activeCtxId)
           
private  void setCtx(int key)
          Updates the reference to the active context.
private  void setDmq(ClientMessages not)
           
protected  void setMsgTxName(Message msg)
           
 void setNbMaxMsg(int nbMaxMsg)
          Sets the maximum number of message for the subscription of this user.
 void setPeriod(long period)
          Sets or unsets the period for this queue.
 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.
private  boolean updateSubscriptionToTopic(AgentId topicId, int contextId, int requestId)
          Updates the proxy's subscription to a topic.
private  boolean updateSubscriptionToTopic(AgentId topicId, int contextId, int requestId, boolean asyncSub)
          Updates the proxy's subscription to a topic.
 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

serialVersionUID

private static final long serialVersionUID
define serialVersionUID for interoperability

See Also:
Constant Field Values

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


dmqId

private AgentId dmqId
Identifier of this proxy dead message queue, null for DMQ not set.


threshold

private int threshold
Threshold above which messages are considered as undeliverable because constantly denied. This value is used as default value at subscription creation. 0 stands for no threshold, -1 for value not set (use server' default value).


nbMaxMsg

protected int nbMaxMsg
Maximum number of Message store in subscriptions (-1 set no limit). This value is used as default value at subscription creation.


contexts

private java.util.Map contexts
Table of the proxy's ClientContext instances.

Key: context identifier
Value: context


subsTable

private java.util.Map subsTable
Table holding the ClientSubscription instances.

Key: subscription name
Value: client subscription


recoveredTransactions

private java.util.Map recoveredTransactions
Table holding the recovered transactions branches.

Key: transaction identifier
Value: XACnxPrepare instance


arrivalsCounter

private long arrivalsCounter
Counter of message arrivals from topics.


proxyAgent

private ProxyAgentItf proxyAgent
The reference of the agent hosting the proxy.


topicsTable

private transient java.util.Map topicsTable
Table holding the TopicSubscription instances.

Key: topic identifier
Value: topic subscription


messagesTable

private transient java.util.Map messagesTable
Table holding the subscriptions' messages.

Key: message identifier
Value: message


activeCtxId

private transient int activeCtxId
Identifier of the active context. Value -1 means that there's no active context.


activeCtx

private transient ClientContext activeCtx
Reference to the active ClientContext instance.


msgTxname

transient java.lang.String msgTxname
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.

getDMQId

public java.lang.String getDMQId()
Returns the default DMQ for subscription of this user.

Specified by:
getDMQId in interface ProxyImplMBean
Returns:
the default DMQ for subscription of this user.

getThreshold

public int getThreshold()
Returns the default threshold for the subscription of this user. 0 stands for no threshold, -1 for value not set.

Specified by:
getThreshold in interface ProxyImplMBean
Returns:
the maximum number of message if set; -1 otherwise.

setThreshold

public void setThreshold(int threshold)
Sets the default threshold for the subscription of this user. 0 stands for no threshold, -1 for value not set.

Specified by:
setThreshold in interface ProxyImplMBean
Parameters:
threshold - the threshold to set.

getNbMaxMsg

public int getNbMaxMsg()
Returns the default maximum number of message for the subscription of this user. If the limit is unset the method returns -1.

Specified by:
getNbMaxMsg in interface ProxyImplMBean
Returns:
the maximum number of message if set; -1 otherwise.

setNbMaxMsg

public void setNbMaxMsg(int nbMaxMsg)
Sets the maximum number of message for the subscription of this user.

Specified by:
setNbMaxMsg in interface ProxyImplMBean
Parameters:
nbMaxMsg - the maximum number of message (-1 set no limit).

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

getName

public java.lang.String getName()
Description copied from interface: ProxyImplMBean
Returns the name of this queue, or its id if not set.

Specified by:
getName in interface ProxyImplMBean
Returns:
the name of this queue; its id if not set.

initialize

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

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

setActiveCtxId

private void setActiveCtxId(int activeCtxId)

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.


reactToClientRequest

private void reactToClientRequest(int key,
                                  ProducerMessages req)
                           throws RequestException
Forwards the messages sent by the client in a ProducerMessages request as a ClientMessages MOM request directly to a destination, and acknowledges them by sending a ServerReply back.

Throws:
RequestException - The destination id is undefined

setDmq

private void setDmq(ClientMessages not)

reactToClientRequest

private void reactToClientRequest(int key,
                                  ConsumerReceiveRequest req)
                           throws RequestException
Either forwards the ConsumerReceiveRequest request as a ReceiveRequest directly to the target queue, or wraps it and sends it to the proxy if destinated to a subscription.

Throws:
RequestException - Undefined (null) destination

reactToClientRequest

private void reactToClientRequest(int key,
                                  ConsumerSetListRequest req)
                           throws RequestException
Either forwards the ConsumerSetListRequest request as a ReceiveRequest directly to the target queue, or wraps it and sends it to the proxy if destinated to a subscription.

Throws:
RequestException - Undefined (null) destination

reactToClientRequest

private void reactToClientRequest(int key,
                                  QBrowseRequest req)
                           throws RequestException
Forwards the client's QBrowseRequest request as a BrowseRequest MOM request directly to a destination.

Throws:
RequestException - Undefined (null) destination

reactToClientRequest

private void reactToClientRequest(int key,
                                  JmsRequestGroup request)

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.

doReact

private void doReact(int key,
                     AbstractJmsRequest request)
Distributes the client requests to the appropriate reactions.

The proxy accepts the following requests:

A JmsExceptReply is sent back to the client when an exception is thrown by the reaction.


doReact

private void doReact(int key,
                     GetAdminTopicRequest req)
              throws AccessException
Method implementing the reaction to a GetAdminTopicRequest requesting the identifier of the local admin topic.

It simply sends back a GetAdminTopicReply holding the admin topic identifier.

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

doReact

private void doReact(int key,
                     CnxConnectRequest req)
              throws DestinationException
Method implementing the reaction to a CnxConnectRequest requesting the key of the active context.

It simply sends back a ConnectReply holding the active context's key.

Throws:
DestinationException - In case of a first administrator context, if the local administration topic reference is not available.

doReact

private void doReact(CnxStartRequest req)
Method implementing the proxy reaction to a CnxStartRequest requesting to start a context.

This method sends the pending ConsumerMessages replies, if any.


doReact

private void doReact(CnxStopRequest req)
Method implementing the JMS proxy reaction to a CnxStopRequest requesting to stop a context.

This method sends a ServerReply back.


doReact

private void doReact(SessCreateDestRequest req)
              throws RequestException
Method implementing the JMS proxy reaction to a SessCreateDestRequest requesting the creation of a destination.

Creates the queue, sends it a SetRightRequest for granting WRITE access to all, and wraps a SessCreateTDReply in a SyncReply notification it sends to itself. This latest action's purpose is to preserve causality. Method implementing the JMS proxy reaction to a SessCreateTTRequest requesting the creation of a temporary topic.

Creates the topic, sends it a SetRightRequest for granting WRITE access to all, and wraps a SessCreateTDReply in a SyncReply notification it sends to itself. This latest action's purpose is to preserve causality.

Throws:
RequestException - If the destination could not be deployed.

doReact

private void doReact(ConsumerSubRequest req)
              throws StateException,
                     RequestException
Method implementing the JMS proxy reaction to a ConsumerSubRequest requesting to subscribe to a topic.

Throws:
StateException - If activating an already active durable subscription.
RequestException - If the subscription parameters are not correct.

doReact

private void doReact(ConsumerSetListRequest req)
              throws DestinationException
Method implementing the JMS proxy reaction to a ConsumerSetListRequest notifying the creation of a client listener.

Sets the listener for the subscription, launches a delivery sequence.

Throws:
DestinationException - If the subscription does not exist.

doReact

private void doReact(ConsumerUnsetListRequest req)
              throws DestinationException
Method implementing the JMS proxy reaction to a ConsumerUnsetListRequest notifying that a consumer listener is unset.

Throws:
DestinationException - If the subscription does not exist.

doReact

private void doReact(ConsumerCloseSubRequest req)
              throws DestinationException
Method implementing the JMS proxy reaction to a ConsumerCloseSubRequest requesting to deactivate a durable subscription.

Throws:
DestinationException - If the subscription does not exist.

doReact

private void doReact(ConsumerUnsubRequest req)
              throws DestinationException
Method implementing the JMS proxy reaction to a ConsumerUnsubRequest requesting to remove a subscription.

Throws:
DestinationException - If the subscription does not exist.

doReact

private void doReact(ConsumerReceiveRequest req)
              throws DestinationException
Method implementing the proxy reaction to a ConsumerReceiveRequest instance, requesting a message from a subscription.

This method registers the request and launches a delivery sequence.

Throws:
DestinationException - If the subscription does not exist.

doReact

private void doReact(SessAckRequest req)
Method implementing the JMS proxy reaction to a SessAckRequest acknowledging messages either on a queue or on a subscription.


doReact

private void doReact(SessDenyRequest req)
Method implementing the JMS proxy reaction to a SessDenyRequest denying messages either on a queue or on a subscription.


doReact

private void doReact(ConsumerAckRequest req)
Method implementing the JMS proxy reaction to a ConsumerAckRequest acknowledging a message either on a queue or on a subscription.


doReact

private void doReact(ConsumerDenyRequest req)
Method implementing the JMS proxy reaction to a ConsumerDenyRequest denying a message either on a queue or on a subscription.

This request is acknowledged when destinated to a queue.


doReact

private void doReact(TempDestDeleteRequest req)
Method implementing the JMS proxy reaction to a TempDestDeleteRequest request for deleting a temporary destination.

This method sends a fr.dyade.aaa.agent.DeleteNot to the destination and acknowledges the request.


deleteTemporaryDestination

private void deleteTemporaryDestination(AgentId destId)

doReact

private void doReact(XACnxPrepare req)
              throws StateException
Method implementing the JMS proxy reaction to an XACnxPrepare request holding messages and acknowledgements produced in an XA transaction.

Throws:
StateException - If the proxy has already received a prepare order for the same transaction.

doReact

private void doReact(XACnxCommit req)
              throws StateException
Method implementing the JMS proxy reaction to an XACnxCommit request committing the operations performed in a given transaction.

This method actually processes the objects sent at the prepare phase, and acknowledges the request.

Throws:
StateException - If committing an unknown transaction.

doReact

private void doReact(XACnxRollback req)
Method implementing the JMS proxy reaction to an XACnxRollback request rolling back the operations performed in a given transaction.


doReact

private void doReact(XACnxRecoverRequest req)
              throws StateException
Reacts to a XACnxRecoverRequest request requesting the identifiers of the prepared transactions.

Returns the identifiers of the recovered transactions, puts the prepared data into the active context for future commit or rollback.

Throws:
StateException - If a recovered transaction branch is already present in the context.

doReact

private void doReact(SyncReply not)
Method implementing the JMS proxy reaction to a SyncReply notification sent by itself, wrapping a reply to be sent to a client.


doReact

private void doReact(int key,
                     CnxCloseRequest req)
The method closes a given context by denying the non acknowledged messages delivered to this context, and deleting its temporary subscriptions and destinations.


doReact

private void doReact(int key,
                     ActivateConsumerRequest req)

doReact

private void doReact(int key,
                     CommitRequest req)

doFwd

private void doFwd(AgentId from,
                   AbstractReplyNot rep)
Distributes the JMS replies to the appropriate reactions.

JMS proxies react the following replies:


doFwd

private void doFwd(AgentId from,
                   QueueMsgReply rep)
Actually forwards a QueueMsgReply coming from a destination as a ConsumerMessages destinated to the requesting client.

If the corresponding context is stopped, stores the ConsumerMessages for later delivery.


doFwd

private void doFwd(BrowseReply rep)
Actually forwards a BrowseReply coming from a destination as a QBrowseReply destinated to the requesting client.


doFwd

private void doFwd(SubscribeReply rep)
Forwards the topic's SubscribeReply as a ServerReply.


getMsgTxname

protected final java.lang.String getMsgTxname()

setMsgTxName

protected final void setMsgTxName(Message msg)

doFwd

private void doFwd(AgentId from,
                   TopicMsgsReply rep)
Method implementing the proxy reaction to a TopicMsgsReply holding messages published by a topic.


doReact

private void doReact(AgentId from,
                     ExceptionReply rep)
Actually forwards an ExceptionReply coming from a destination as a MomExceptionReply destinated to the requesting client.

If the wrapped exception is an AccessException thrown by a Topic as a reply to a SubscribeRequest, removing the corresponding subscriptions.


getMBeanName

private java.lang.String getMBeanName(java.lang.String name)

doReact

private void doReact(AdminReplyNot reply)
An AdminReply acknowledges the setting of a temporary destination; nothing needs to be done.


doReact

private void doReact(UnknownAgent uA)
Method implementing the JMS proxy reaction to an UnknownAgent notification notifying that a destination does not exist or is deleted.

If it notifies of a deleted topic, the method removes the corresponding subscriptions. If the wrapped request is messages sending, the messages are sent to the DMQ.

A JmsExceptReply is sent to the concerned requester.

This case might also happen when sending a ClientMessages to a dead message queue. In that case, the invalid DMQ identifier is set to null.


doReact

private void doReact(FwdAdminRequestNot not)

doReact

private void doReact(GetSubscriptions request,
                     AgentId replyTo,
                     java.lang.String requestMsgId,
                     java.lang.String replyMsgId)

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.

doReact

private void doReact(GetSubscriptionMessageIds request,
                     AgentId replyTo,
                     java.lang.String requestMsgId,
                     java.lang.String replyMsgId)

doReact

private void doReact(GetSubscription request,
                     AgentId replyTo,
                     java.lang.String requestMsgId,
                     java.lang.String replyMsgId)

doReact

private void doReact(GetSubscriptionMessage request,
                     AgentId replyTo,
                     java.lang.String requestMsgId,
                     java.lang.String replyMsgId)

doReact

private void doReact(DeleteSubscriptionMessage request,
                     AgentId replyTo,
                     java.lang.String requestMsgId,
                     java.lang.String replyMsgId)

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.

doReact

private void doReact(ClearSubscription request,
                     AgentId replyTo,
                     java.lang.String requestMsgId,
                     java.lang.String replyMsgId)

replyToTopic

private void replyToTopic(AdminReply reply,
                          AgentId replyTo,
                          java.lang.String requestMsgId,
                          java.lang.String replyMsgId)

setCtx

private void setCtx(int key)
             throws StateException
Updates the reference to the active context.

Parameters:
key - Key of the activated context.
Throws:
StateException - If the context has actually been closed or lost.

doReply

private void doReply(AbstractJmsReply reply)
Method used for sending an AbstractJmsReply back to an external client within the active context.

Parameters:
rep - The reply to send.

getClientContext

ClientContext getClientContext(int ctxId)

doReply

private void doReply(int key,
                     AbstractJmsReply reply)
Method used for sending an AbstractJmsReply back to an external client through a given context.

Parameters:
key - The context through witch replying.
rep - The reply to send.

cleanPendingMessages

void cleanPendingMessages(long currentTime)

delete

public void delete()
Description copied from interface: ProxyImplMBean
Deletes this proxy.

Specified by:
delete in interface ProxyImplMBean

deleteProxy

private void deleteProxy(FwdAdminRequestNot not)
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.

updateSubscriptionToTopic

private boolean updateSubscriptionToTopic(AgentId topicId,
                                          int contextId,
                                          int requestId)
Updates the proxy's subscription to a topic.

Parameters:
topicId - Identifier of the topic to subscribe to.
contextId - Identifier of the subscription context.
requestId - Identifier of the subscription request.
Returns:
true if a SubscribeRequest has been sent to the topic.

updateSubscriptionToTopic

private boolean updateSubscriptionToTopic(AgentId topicId,
                                          int contextId,
                                          int requestId,
                                          boolean asyncSub)
Updates the proxy's subscription to a topic.

Parameters:
topicId - Identifier of the topic to subscribe to.
contextId - Identifier of the subscription context.
requestId - Identifier of the subscription request.
asyncSub - asynchronous subscription request.
Returns:
true if a SubscribeRequest has been sent to the topic.

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.


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.