public final class ActiveMQRAManagedConnection extends Object implements javax.resource.spi.ManagedConnection, javax.jms.ExceptionListener
| Constructor and Description |
|---|
ActiveMQRAManagedConnection(ActiveMQRAManagedConnectionFactory mcf,
ActiveMQRAConnectionRequestInfo cri,
ActiveMQResourceAdapter ra,
String userName,
String password)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
Add a connection event listener.
|
void |
associateConnection(Object obj)
Move a handler from one mc to this one.
|
void |
checkTransactionActive() |
void |
cleanup()
Cleanup
|
void |
destroy()
Destroy the physical connection.
|
Object |
getConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
Get a connection
|
ActiveMQConnectionFactory |
getConnectionFactory() |
protected ActiveMQRAConnectionRequestInfo |
getCRI()
Get the request info for this connection.
|
javax.resource.spi.LocalTransaction |
getLocalTransaction()
Get the location transaction for the connection.
|
PrintWriter |
getLogWriter()
Get the log writer -- NOT SUPPORTED
|
protected ActiveMQRAManagedConnectionFactory |
getManagedConnectionFactory()
Get the connection factory for this connection.
|
javax.resource.spi.ManagedConnectionMetaData |
getMetaData()
Get the meta data for the connection.
|
protected javax.jms.Session |
getSession()
Get the session for this connection.
|
protected String |
getUserName()
Get the user name
|
XAResource |
getXAResource()
Get the XAResource for the connection.
|
protected void |
lock()
Aqquire a lock on the managed connection
|
void |
onException(javax.jms.JMSException exception)
Notifies user of a JMS exception.
|
void |
removeConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
Remove a connection event listener.
|
protected void |
removeHandle(ActiveMQRASession handle)
Remove a handle from the handle map.
|
protected void |
sendEvent(javax.resource.spi.ConnectionEvent event)
Send an event.
|
protected void |
setInManagedTx(boolean inManagedTx) |
void |
setLogWriter(PrintWriter out)
Set the log writer -- NOT SUPPORTED
|
protected void |
tryLock()
Aqquire a lock on the managed connection within the specified period
|
protected void |
unlock()
Unlock the managed connection
|
public ActiveMQRAManagedConnection(ActiveMQRAManagedConnectionFactory mcf, ActiveMQRAConnectionRequestInfo cri, ActiveMQResourceAdapter ra, String userName, String password) throws javax.resource.ResourceException
mcf - The managed connection factorycri - The connection request informationuserName - The user namepassword - The passwordjavax.resource.ResourceExceptionpublic Object getConnection(Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo) throws javax.resource.ResourceException
getConnection in interface javax.resource.spi.ManagedConnectionsubject - The security subjectcxRequestInfo - The request infojavax.resource.ResourceException - Thrown if an error occurspublic void destroy()
throws javax.resource.ResourceException
destroy in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - Could not property close the session and connection.public void cleanup()
throws javax.resource.ResourceException
cleanup in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - Thrown if an error occurspublic void associateConnection(Object obj) throws javax.resource.ResourceException
associateConnection in interface javax.resource.spi.ManagedConnectionobj - An object of type ActiveMQSession.javax.resource.ResourceException - Failed to associate connection.javax.resource.spi.IllegalStateException - ManagedConnection in an illegal state.public void checkTransactionActive()
throws javax.jms.JMSException
javax.jms.JMSExceptionprotected void lock()
protected void tryLock()
throws javax.jms.JMSException
javax.jms.JMSException - Thrown if an error occursprotected void unlock()
public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
addConnectionEventListener in interface javax.resource.spi.ManagedConnectionl - The connection event listener to be added.public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
removeConnectionEventListener in interface javax.resource.spi.ManagedConnectionl - The connection event listener to be removed.public XAResource getXAResource() throws javax.resource.ResourceException
getXAResource in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - XA transaction not supportedpublic javax.resource.spi.LocalTransaction getLocalTransaction()
throws javax.resource.ResourceException
getLocalTransaction in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - Thrown if operation fails.public javax.resource.spi.ManagedConnectionMetaData getMetaData()
throws javax.resource.ResourceException
getMetaData in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - Thrown if the operation fails.javax.resource.spi.IllegalStateException - Thrown if the managed connection already is destroyed.public void setLogWriter(PrintWriter out) throws javax.resource.ResourceException
setLogWriter in interface javax.resource.spi.ManagedConnectionout - The log writerjavax.resource.ResourceException - If operation failspublic PrintWriter getLogWriter() throws javax.resource.ResourceException
getLogWriter in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - If operation failspublic void onException(javax.jms.JMSException exception)
onException in interface javax.jms.ExceptionListenerexception - The JMS exceptionprotected javax.jms.Session getSession()
throws javax.jms.JMSException
javax.jms.JMSExceptionprotected void sendEvent(javax.resource.spi.ConnectionEvent event)
event - The event to send.protected void removeHandle(ActiveMQRASession handle)
handle - The handle to remove.protected ActiveMQRAConnectionRequestInfo getCRI()
protected ActiveMQRAManagedConnectionFactory getManagedConnectionFactory()
protected String getUserName()
protected void setInManagedTx(boolean inManagedTx)
public ActiveMQConnectionFactory getConnectionFactory()
Copyright © 2020 The Apache Software Foundation. All Rights Reserved.