public class QpidRAManagedConnection extends Object implements javax.resource.spi.ManagedConnection, javax.jms.ExceptionListener
Constructor and Description |
---|
QpidRAManagedConnection(QpidRAManagedConnectionFactory mcf,
QpidRAConnectionRequestInfo cri,
TransactionManager tm,
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
|
protected QpidRAConnectionRequestInfo |
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 QpidRAManagedConnectionFactory |
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.
|
boolean |
isConnectionClosed() |
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(QpidRASessionImpl 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 QpidRAManagedConnection(QpidRAManagedConnectionFactory mcf, QpidRAConnectionRequestInfo cri, TransactionManager tm, String userName, String password) throws javax.resource.ResourceException
mcf
- The managed connection factorycri
- The connection request informationuserName
- The user namepassword
- The passwordjavax.resource.ResourceException
public Object getConnection(Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo) throws javax.resource.ResourceException
getConnection
in interface javax.resource.spi.ManagedConnection
subject
- 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.ManagedConnection
javax.resource.ResourceException
- Could not property close the session and connection.public void cleanup() throws javax.resource.ResourceException
cleanup
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- Thrown if an error occurspublic void associateConnection(Object obj) throws javax.resource.ResourceException
associateConnection
in interface javax.resource.spi.ManagedConnection
obj
- An object of type QpidRASession.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.JMSException
protected 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.ManagedConnection
l
- The connection event listener to be added.public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
removeConnectionEventListener
in interface javax.resource.spi.ManagedConnection
l
- The connection event listener to be removed.public XAResource getXAResource() throws javax.resource.ResourceException
getXAResource
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- XA transaction not supportedpublic javax.resource.spi.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException
getLocalTransaction
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- Thrown if operation fails.public javax.resource.spi.ManagedConnectionMetaData getMetaData() throws javax.resource.ResourceException
getMetaData
in interface javax.resource.spi.ManagedConnection
javax.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.ManagedConnection
out
- The log writerjavax.resource.ResourceException
- If operation failspublic PrintWriter getLogWriter() throws javax.resource.ResourceException
getLogWriter
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- If operation failspublic void onException(javax.jms.JMSException exception)
onException
in interface javax.jms.ExceptionListener
exception
- The JMS exceptionprotected javax.jms.Session getSession() throws javax.jms.JMSException
javax.jms.JMSException
protected void sendEvent(javax.resource.spi.ConnectionEvent event)
event
- The event to send.protected void removeHandle(QpidRASessionImpl handle)
handle
- The handle to remove.protected QpidRAConnectionRequestInfo getCRI()
protected QpidRAManagedConnectionFactory getManagedConnectionFactory()
protected String getUserName()
protected void setInManagedTx(boolean inManagedTx)
public boolean isConnectionClosed()
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.