public class OutboundConnection extends Object implements Connection, OutboundConnectionMBean
OutboundConnection
instance 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).Modifier and Type | Field and Description |
---|---|
static org.objectweb.util.monolog.api.Logger |
logger |
(package private) ManagedConnectionImpl |
managedCx
The managed connection this "handle" belongs to.
|
(package private) Vector |
sessions
Vector of the connection's sessions.
|
(package private) boolean |
valid
true if this "handle" is valid. |
(package private) XAConnection |
xac
The physical connection this "handle" handles.
|
Constructor and Description |
---|
OutboundConnection(ManagedConnectionImpl managedCx,
XAConnection xac)
Constructs an
OutboundConnection instance. |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Close all sessions.
|
void |
close()
Requests to close the physical connection.
|
boolean |
cnxEquals(Object obj)
Returns
true if the parameter is a Connection instance sharing the same
proxy identifier and connection key. |
ConnectionConsumer |
createConnectionConsumer(Destination destination,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
Forbidden call on an application or component's outbound connection,
throws a
IllegalStateException instance. |
ConnectionConsumer |
createDurableConnectionConsumer(Topic topic,
String subscriptionName,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
Forbidden call on an application or component's outbound connection,
throws a
IllegalStateException instance. |
Session |
createSession() |
Session |
createSession(boolean transacted,
int acknowledgeMode)
Returns the unique authorized JMS session per connection wrapped
in an
OutboundSession instance. |
Session |
createSession(int sessionMode) |
ConnectionConsumer |
createSharedConnectionConsumer(Topic topic,
String subscriptionName,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages) |
ConnectionConsumer |
createSharedDurableConnectionConsumer(Topic topic,
String subscriptionName,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages) |
String |
getClientID()
Forbidden call on an application or component's outbound connection,
throws a
IllegalStateException instance. |
ExceptionListener |
getExceptionListener()
Forbidden call on an application or component's outbound connection,
throws a
IllegalStateException instance. |
String |
getJMXBeanName(XAConnection cnx) |
ConnectionMetaData |
getMetaData()
Delegates the call to the wrapped JMS connection.
|
int |
getNumberOfSession() |
String[] |
getSessions() |
String |
registerMBean() |
void |
setClientID(String clientID)
Forbidden call on an application or component's outbound connection,
throws a
IllegalStateException instance. |
void |
setExceptionListener(ExceptionListener listener)
Forbidden call on an application or component's outbound connection,
throws a
IllegalStateException instance. |
void |
start()
Delegates the call to the wrapped JMS connection.
|
void |
stop()
Forbidden call on an application or component's outbound connection,
throws a
IllegalStateException instance. |
String |
toString() |
void |
unregisterMBean() |
public static org.objectweb.util.monolog.api.Logger logger
ManagedConnectionImpl managedCx
XAConnection xac
boolean valid
true
if this "handle" is valid.Vector sessions
OutboundConnection(ManagedConnectionImpl managedCx, XAConnection xac)
OutboundConnection
instance.managedCx
- The managed connection building the handle.xac
- The underlying physical connection to handle.public void setClientID(String clientID) throws JMSException
IllegalStateException
instance.setClientID
in interface Connection
JMSException
public void setExceptionListener(ExceptionListener listener) throws JMSException
IllegalStateException
instance.setExceptionListener
in interface Connection
JMSException
public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
OutboundSession
instance.createSession
in interface Connection
IllegalStateException
- If the handle is invalid.JMSException
- Generic exception.public String getClientID() throws JMSException
IllegalStateException
instance.getClientID
in interface Connection
JMSException
public ConnectionMetaData getMetaData() throws JMSException
getMetaData
in interface Connection
IllegalStateException
- If the handle is invalid.JMSException
- Generic exception.public ExceptionListener getExceptionListener() throws JMSException
IllegalStateException
instance.getExceptionListener
in interface Connection
JMSException
public void start() throws JMSException
start
in interface Connection
IllegalStateException
- If the handle is invalid.JMSException
- Generic exception.public void stop() throws JMSException
IllegalStateException
instance.stop
in interface Connection
JMSException
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
IllegalStateException
instance.createConnectionConsumer
in interface Connection
JMSException
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
IllegalStateException
instance.createDurableConnectionConsumer
in interface Connection
JMSException
public void close() throws JMSException
close
in interface AutoCloseable
close
in interface Connection
close
in interface OutboundConnectionMBean
IllegalStateException
- If the handle is invalid.JMSException
- Generic exception.public boolean cnxEquals(Object obj)
true
if the parameter is a Connection
instance sharing the same
proxy identifier and connection key.public void cleanup()
public String getJMXBeanName(XAConnection cnx)
public String registerMBean()
public void unregisterMBean()
public int getNumberOfSession()
getNumberOfSession
in interface OutboundConnectionMBean
public String[] getSessions()
getSessions
in interface OutboundConnectionMBean
public Session createSession(int sessionMode) throws JMSException
createSession
in interface Connection
JMSException
public Session createSession() throws JMSException
createSession
in interface Connection
JMSException
public ConnectionConsumer createSharedConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createSharedConnectionConsumer
in interface Connection
JMSException
public ConnectionConsumer createSharedDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
createSharedDurableConnectionConsumer
in interface Connection
JMSException
Copyright © 2019 ScalAgent D.T.. All rights reserved.