Package org.ow2.joram.jakarta.connector
Class OutboundConnection
- java.lang.Object
-
- org.ow2.joram.jakarta.connector.OutboundConnection
-
- All Implemented Interfaces:
jakarta.jms.Connection,AutoCloseable,OutboundConnectionMBean
- Direct Known Subclasses:
OutboundQueueConnection,OutboundTopicConnection
public class OutboundConnection extends Object implements jakarta.jms.Connection, OutboundConnectionMBean
AnOutboundConnectioninstance is a handler for a physical connection to an underlying JORAM server, allowing a component to transparently use this physical connection possibly within a transaction (local or global).
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGprivate static Loggerlogger(package private) ManagedConnectionImplmanagedCxThe managed connection this "handle" belongs to.(package private) Vector<OutboundSession>sessionsVector of the connection's sessions.(package private) booleanvalidtrueif this "handle" is valid.(package private) jakarta.jms.XAConnectionxacThe physical connection this "handle" handles.
-
Constructor Summary
Constructors Constructor Description OutboundConnection(ManagedConnectionImpl managedCx, jakarta.jms.XAConnection xac)Constructs anOutboundConnectioninstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Close all sessions.voidclose()Requests to close the physical connection.booleancnxEquals(Object obj)Returnstrueif the parameter is aConnectioninstance sharing the same proxy identifier and connection key.jakarta.jms.ConnectionConsumercreateConnectionConsumer(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages)Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.jakarta.jms.ConnectionConsumercreateDurableConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages)Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.(package private) jakarta.jms.SessioncreateManagedSession(int acknowledgeMode)jakarta.jms.SessioncreateSession()jakarta.jms.SessioncreateSession(boolean transacted, int acknowledgeMode)Returns the unique authorized JMS session per connection wrapped in anOutboundSessioninstance.jakarta.jms.SessioncreateSession(int sessionMode)jakarta.jms.ConnectionConsumercreateSharedConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages)jakarta.jms.ConnectionConsumercreateSharedDurableConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages)StringgetClientID()Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.jakarta.jms.ExceptionListenergetExceptionListener()Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.StringgetJMXBeanName(jakarta.jms.XAConnection cnx)jakarta.jms.ConnectionMetaDatagetMetaData()Delegates the call to the wrapped JMS connection.intgetNumberOfSession()String[]getSessions()StringregisterMBean()voidsetClientID(String clientID)Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.voidsetExceptionListener(jakarta.jms.ExceptionListener listener)Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.voidstart()Delegates the call to the wrapped JMS connection.voidstop()Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.StringtoString()voidunregisterMBean()
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
managedCx
ManagedConnectionImpl managedCx
The managed connection this "handle" belongs to.
-
xac
jakarta.jms.XAConnection xac
The physical connection this "handle" handles.
-
valid
boolean valid
trueif this "handle" is valid.
-
sessions
Vector<OutboundSession> sessions
Vector of the connection's sessions.
-
-
Constructor Detail
-
OutboundConnection
OutboundConnection(ManagedConnectionImpl managedCx, jakarta.jms.XAConnection xac)
Constructs anOutboundConnectioninstance.- Parameters:
managedCx- The managed connection building the handle.xac- The underlying physical connection to handle.
-
-
Method Detail
-
cnxEquals
public boolean cnxEquals(Object obj)
Returnstrueif the parameter is aConnectioninstance sharing the same proxy identifier and connection key.
-
cleanup
public void cleanup()
Close all sessions.
-
createSession
public jakarta.jms.Session createSession() throws jakarta.jms.JMSException- Specified by:
createSessionin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
createSession
public jakarta.jms.Session createSession(int sessionMode) throws jakarta.jms.JMSException- Specified by:
createSessionin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
createSession
public jakarta.jms.Session createSession(boolean transacted, int acknowledgeMode) throws jakarta.jms.JMSExceptionReturns the unique authorized JMS session per connection wrapped in anOutboundSessioninstance.- Specified by:
createSessionin interfacejakarta.jms.Connection- Throws:
jakarta.jms.IllegalStateException- If the handle is invalid.jakarta.jms.JMSException- Generic exception.
-
createManagedSession
jakarta.jms.Session createManagedSession(int acknowledgeMode) throws jakarta.jms.JMSException- Throws:
jakarta.jms.JMSException
-
getClientID
public String getClientID() throws jakarta.jms.JMSException
Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.- Specified by:
getClientIDin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
setClientID
public void setClientID(String clientID) throws jakarta.jms.JMSException
Forbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.- Specified by:
setClientIDin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
getMetaData
public jakarta.jms.ConnectionMetaData getMetaData() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS connection.- Specified by:
getMetaDatain interfacejakarta.jms.Connection- Throws:
jakarta.jms.IllegalStateException- If the handle is invalid.jakarta.jms.JMSException- Generic exception.
-
getExceptionListener
public jakarta.jms.ExceptionListener getExceptionListener() throws jakarta.jms.JMSExceptionForbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.- Specified by:
getExceptionListenerin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
setExceptionListener
public void setExceptionListener(jakarta.jms.ExceptionListener listener) throws jakarta.jms.JMSExceptionForbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.- Specified by:
setExceptionListenerin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
start
public void start() throws jakarta.jms.JMSExceptionDelegates the call to the wrapped JMS connection.- Specified by:
startin interfacejakarta.jms.Connection- Throws:
jakarta.jms.IllegalStateException- If the handle is invalid.jakarta.jms.JMSException- Generic exception.
-
stop
public void stop() throws jakarta.jms.JMSExceptionForbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.- Specified by:
stopin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
createConnectionConsumer
public jakarta.jms.ConnectionConsumer createConnectionConsumer(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSExceptionForbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.- Specified by:
createConnectionConsumerin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
createDurableConnectionConsumer
public jakarta.jms.ConnectionConsumer createDurableConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSExceptionForbidden call on an application or component's outbound connection, throws aIllegalStateExceptioninstance.- Specified by:
createDurableConnectionConsumerin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
close
public void close() throws jakarta.jms.JMSExceptionRequests to close the physical connection.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacejakarta.jms.Connection- Specified by:
closein interfaceOutboundConnectionMBean- Throws:
jakarta.jms.IllegalStateException- If the handle is invalid.jakarta.jms.JMSException- Generic exception.
-
getNumberOfSession
public int getNumberOfSession()
- Specified by:
getNumberOfSessionin interfaceOutboundConnectionMBean
-
getSessions
public String[] getSessions()
- Specified by:
getSessionsin interfaceOutboundConnectionMBean
-
createSharedConnectionConsumer
public jakarta.jms.ConnectionConsumer createSharedConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSException- Specified by:
createSharedConnectionConsumerin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
createSharedDurableConnectionConsumer
public jakarta.jms.ConnectionConsumer createSharedDurableConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSException- Specified by:
createSharedDurableConnectionConsumerin interfacejakarta.jms.Connection- Throws:
jakarta.jms.JMSException
-
getJMXBeanName
public String getJMXBeanName(jakarta.jms.XAConnection cnx)
-
registerMBean
public String registerMBean()
-
unregisterMBean
public void unregisterMBean()
-
-