Package org.apache.activemq.ra
Class ManagedConnectionProxy
- java.lang.Object
-
- org.apache.activemq.ra.ManagedConnectionProxy
-
- All Implemented Interfaces:
Connection,ExceptionListener,QueueConnection,TopicConnection
public class ManagedConnectionProxy extends Object implements Connection, QueueConnection, TopicConnection, ExceptionListener
Acts as a pass through proxy for a JMS Connection object. It intercepts events that are of interest of the ActiveMQManagedConnection.
-
-
Constructor Summary
Constructors Constructor Description ManagedConnectionProxy(ActiveMQManagedConnection managedConnection, ConnectionRequestInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Called by the ActiveMQManagedConnection to invalidate this proxy.voidclose()Used to let the ActiveMQManagedConnection that this connection handel is not needed by the app.ConnectionConsumercreateConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages)ConnectionConsumercreateConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages)ConnectionConsumercreateConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages)ConnectionConsumercreateDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages)QueueSessioncreateQueueSession(boolean transacted, int acknowledgeMode)SessioncreateSession(boolean transacted, int acknowledgeMode)TopicSessioncreateTopicSession(boolean transacted, int acknowledgeMode)StringgetClientID()ExceptionListenergetExceptionListener()ActiveMQManagedConnectiongetManagedConnection()ConnectionMetaDatagetMetaData()voidonException(JMSException e)protected voidsessionClosed(ManagedSessionProxy session)voidsetClientID(String clientID)Sets client id on delegatevoidsetExceptionListener(ExceptionListener listener)sets exception listener on delegatevoidsetUseSharedTxContext(boolean enable)voidstart()voidstop()
-
-
-
Constructor Detail
-
ManagedConnectionProxy
public ManagedConnectionProxy(ActiveMQManagedConnection managedConnection, ConnectionRequestInfo info)
-
-
Method Detail
-
close
public void close() throws JMSExceptionUsed to let the ActiveMQManagedConnection that this connection handel is not needed by the app.- Specified by:
closein interfaceConnection- Throws:
JMSException
-
cleanup
public void cleanup()
Called by the ActiveMQManagedConnection to invalidate this proxy.
-
createSession
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
- Specified by:
createSessionin interfaceConnection- Parameters:
transacted- Whether session is transactedacknowledgeMode- session acknowledge mode- Returns:
- session proxy
- Throws:
JMSException- on error
-
sessionClosed
protected void sessionClosed(ManagedSessionProxy session)
-
setUseSharedTxContext
public void setUseSharedTxContext(boolean enable) throws JMSException- Throws:
JMSException
-
createQueueSession
public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
- Specified by:
createQueueSessionin interfaceQueueConnection- Parameters:
transacted- Whether session is transactedacknowledgeMode- session acknowledge mode- Returns:
- session proxy
- Throws:
JMSException- on error
-
createTopicSession
public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException
- Specified by:
createTopicSessionin interfaceTopicConnection- Parameters:
transacted- Whether session is transactedacknowledgeMode- session acknowledge mode- Returns:
- session proxy
- Throws:
JMSException- on error
-
getClientID
public String getClientID() throws JMSException
- Specified by:
getClientIDin interfaceConnection- Returns:
- client id from delegate
- Throws:
JMSException
-
getExceptionListener
public ExceptionListener getExceptionListener() throws JMSException
- Specified by:
getExceptionListenerin interfaceConnection- Returns:
- exception listener from delegate
- Throws:
JMSException
-
getMetaData
public ConnectionMetaData getMetaData() throws JMSException
- Specified by:
getMetaDatain interfaceConnection- Returns:
- connection metadata from delegate
- Throws:
JMSException
-
setClientID
public void setClientID(String clientID) throws JMSException
Sets client id on delegate- Specified by:
setClientIDin interfaceConnection- Parameters:
clientID- new clientId- Throws:
JMSException
-
setExceptionListener
public void setExceptionListener(ExceptionListener listener) throws JMSException
sets exception listener on delegate- Specified by:
setExceptionListenerin interfaceConnection- Parameters:
listener- new listener- Throws:
JMSException
-
start
public void start() throws JMSException- Specified by:
startin interfaceConnection- Throws:
JMSException
-
stop
public void stop() throws JMSException- Specified by:
stopin interfaceConnection- Throws:
JMSException
-
createConnectionConsumer
public ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Specified by:
createConnectionConsumerin interfaceQueueConnection- Parameters:
queue-messageSelector-sessionPool-maxMessages-- Returns:
- Throws:
JMSException
-
createConnectionConsumer
public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Specified by:
createConnectionConsumerin interfaceTopicConnection- Parameters:
topic-messageSelector-sessionPool-maxMessages-- Returns:
- Throws:
JMSException
-
createConnectionConsumer
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Specified by:
createConnectionConsumerin interfaceConnection- Parameters:
destination-messageSelector-sessionPool-maxMessages-- Returns:
- Throws:
JMSException
-
createDurableConnectionConsumer
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Specified by:
createDurableConnectionConsumerin interfaceConnection- Specified by:
createDurableConnectionConsumerin interfaceTopicConnection- Parameters:
topic-subscriptionName-messageSelector-sessionPool-maxMessages-- Returns:
- Throws:
JMSException
-
getManagedConnection
public ActiveMQManagedConnection getManagedConnection()
- Returns:
- Returns the managedConnection.
-
onException
public void onException(JMSException e)
- Specified by:
onExceptionin interfaceExceptionListener
-
-