org.apache.activemq.ra
Class ManagedConnectionProxy

java.lang.Object
  extended by org.apache.activemq.ra.ManagedConnectionProxy
All Implemented Interfaces:
javax.jms.Connection, javax.jms.ExceptionListener, javax.jms.QueueConnection, javax.jms.TopicConnection

public class ManagedConnectionProxy
extends java.lang.Object
implements javax.jms.Connection, javax.jms.QueueConnection, javax.jms.TopicConnection, javax.jms.ExceptionListener

Acts as a pass through proxy for a JMS Connection object. It intercepts events that are of interest of the ActiveMQManagedConnection.

Version:
$Revision$

Constructor Summary
ManagedConnectionProxy(ActiveMQManagedConnection managedConnection)
           
 
Method Summary
 void cleanup()
          Called by the ActiveMQManagedConnection to invalidate this proxy.
 void close()
          Used to let the ActiveMQManagedConnection that this connection handel is not needed by the app.
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.QueueSession createQueueSession(boolean transacted, int acknowledgeMode)
           
 javax.jms.Session createSession(boolean transacted, int acknowledgeMode)
           
 javax.jms.TopicSession createTopicSession(boolean transacted, int acknowledgeMode)
           
 java.lang.String getClientID()
           
 javax.jms.ExceptionListener getExceptionListener()
           
 ActiveMQManagedConnection getManagedConnection()
           
 javax.jms.ConnectionMetaData getMetaData()
           
 void onException(javax.jms.JMSException e)
           
 void setClientID(java.lang.String clientID)
           
 void setExceptionListener(javax.jms.ExceptionListener listener)
           
 void setUseSharedTxContext(boolean enable)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedConnectionProxy

public ManagedConnectionProxy(ActiveMQManagedConnection managedConnection)
Method Detail

close

public void close()
           throws javax.jms.JMSException
Used to let the ActiveMQManagedConnection that this connection handel is not needed by the app.

Specified by:
close in interface javax.jms.Connection
Throws:
javax.jms.JMSException

cleanup

public void cleanup()
Called by the ActiveMQManagedConnection to invalidate this proxy.


createSession

public javax.jms.Session createSession(boolean transacted,
                                       int acknowledgeMode)
                                throws javax.jms.JMSException
Specified by:
createSession in interface javax.jms.Connection
Parameters:
transacted -
acknowledgeMode -
Returns:
Throws:
javax.jms.JMSException

setUseSharedTxContext

public void setUseSharedTxContext(boolean enable)
                           throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createQueueSession

public javax.jms.QueueSession createQueueSession(boolean transacted,
                                                 int acknowledgeMode)
                                          throws javax.jms.JMSException
Specified by:
createQueueSession in interface javax.jms.QueueConnection
Parameters:
transacted -
acknowledgeMode -
Returns:
Throws:
javax.jms.JMSException

createTopicSession

public javax.jms.TopicSession createTopicSession(boolean transacted,
                                                 int acknowledgeMode)
                                          throws javax.jms.JMSException
Specified by:
createTopicSession in interface javax.jms.TopicConnection
Parameters:
transacted -
acknowledgeMode -
Returns:
Throws:
javax.jms.JMSException

getClientID

public java.lang.String getClientID()
                             throws javax.jms.JMSException
Specified by:
getClientID in interface javax.jms.Connection
Returns:
Throws:
javax.jms.JMSException

getExceptionListener

public javax.jms.ExceptionListener getExceptionListener()
                                                 throws javax.jms.JMSException
Specified by:
getExceptionListener in interface javax.jms.Connection
Returns:
Throws:
javax.jms.JMSException

getMetaData

public javax.jms.ConnectionMetaData getMetaData()
                                         throws javax.jms.JMSException
Specified by:
getMetaData in interface javax.jms.Connection
Returns:
Throws:
javax.jms.JMSException

setClientID

public void setClientID(java.lang.String clientID)
                 throws javax.jms.JMSException
Specified by:
setClientID in interface javax.jms.Connection
Parameters:
clientID -
Throws:
javax.jms.JMSException

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener listener)
                          throws javax.jms.JMSException
Specified by:
setExceptionListener in interface javax.jms.Connection
Parameters:
listener -
Throws:
javax.jms.JMSException

start

public void start()
           throws javax.jms.JMSException
Specified by:
start in interface javax.jms.Connection
Throws:
javax.jms.JMSException

stop

public void stop()
          throws javax.jms.JMSException
Specified by:
stop in interface javax.jms.Connection
Throws:
javax.jms.JMSException

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws javax.jms.JMSException
Specified by:
createConnectionConsumer in interface javax.jms.QueueConnection
Parameters:
queue -
messageSelector -
sessionPool -
maxMessages -
Returns:
Throws:
javax.jms.JMSException

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws javax.jms.JMSException
Specified by:
createConnectionConsumer in interface javax.jms.TopicConnection
Parameters:
topic -
messageSelector -
sessionPool -
maxMessages -
Returns:
Throws:
javax.jms.JMSException

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws javax.jms.JMSException
Specified by:
createConnectionConsumer in interface javax.jms.Connection
Parameters:
destination -
messageSelector -
sessionPool -
maxMessages -
Returns:
Throws:
javax.jms.JMSException

createDurableConnectionConsumer

public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic,
                                                                    java.lang.String subscriptionName,
                                                                    java.lang.String messageSelector,
                                                                    javax.jms.ServerSessionPool sessionPool,
                                                                    int maxMessages)
                                                             throws javax.jms.JMSException
Specified by:
createDurableConnectionConsumer in interface javax.jms.Connection
Specified by:
createDurableConnectionConsumer in interface javax.jms.TopicConnection
Parameters:
topic -
subscriptionName -
messageSelector -
sessionPool -
maxMessages -
Returns:
Throws:
javax.jms.JMSException

getManagedConnection

public ActiveMQManagedConnection getManagedConnection()
Returns:
Returns the managedConnection.

onException

public void onException(javax.jms.JMSException e)
Specified by:
onException in interface javax.jms.ExceptionListener


Copyright © 2010 Apache Software Foundation. All Rights Reserved.