Package org.apache.jackrabbit.jca
Class JCAManagedConnection
- java.lang.Object
- 
- org.apache.jackrabbit.jca.JCAManagedConnection
 
- 
- All Implemented Interfaces:
- javax.resource.spi.ManagedConnection,- javax.resource.spi.ManagedConnectionMetaData
 
 public class JCAManagedConnection extends Object implements javax.resource.spi.ManagedConnection, javax.resource.spi.ManagedConnectionMetaData This class implements the managed connection for this resource adapter.
- 
- 
Constructor SummaryConstructors Constructor Description JCAManagedConnection(JCAManagedConnectionFactory mcf, JCAConnectionRequestInfo cri)Construct the managed connection.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)Adds a listener.voidassociateConnection(Object connection)Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance.voidcleanup()Application server calls this method to force any cleanup on the ManagedConnection instance.voidcloseHandle(JCASessionHandle handle)Close the handle.voiddestroy()Destroys the physical connection to the underlying resource manager.ObjectgetConnection(Subject subject, javax.resource.spi.ConnectionRequestInfo cri)Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance.JCAConnectionRequestInfogetConnectionRequestInfo()Return the connection request info.StringgetEISProductName()Return the product name.StringgetEISProductVersion()Return the product version.javax.resource.spi.LocalTransactiongetLocalTransaction()Returns an javax.resource.spi.LocalTransaction instance.PrintWritergetLogWriter()Get the log writer.JCAManagedConnectionFactorygetManagedConnectionFactory()Return the managed connection factory.intgetMaxConnections()Return number of max connections.javax.resource.spi.ManagedConnectionMetaDatagetMetaData()Gets the metadata information for this connection's underlying EIS resource manager instance.SessiongetSession(JCASessionHandle handle)Return the session.StringgetUserName()Return the user name.XAResourcegetXAResource()Returns an javax.transaction.xa.XAresource instance.voidlog(String message)Log a message.voidlog(String message, Throwable exception)Log a message.voidremoveConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)Remove a listener.voidsendrrorEvent(JCASessionHandle handle, Exception cause)Send connection error event.voidsendTxCommittedEvent(JCASessionHandle handle)Send transaction committed event.voidsendTxRolledbackEvent(JCASessionHandle handle)Send transaction rolledback event.voidsendTxStartedEvent(JCASessionHandle handle)Send transaction started event.voidsetLogWriter(PrintWriter logWriter)Set the log writer.
 
- 
- 
- 
Constructor Detail- 
JCAManagedConnectionpublic JCAManagedConnection(JCAManagedConnectionFactory mcf, JCAConnectionRequestInfo cri) throws javax.resource.ResourceException Construct the managed connection.- Throws:
- javax.resource.ResourceException
 
 
- 
 - 
Method Detail- 
getManagedConnectionFactorypublic JCAManagedConnectionFactory getManagedConnectionFactory() Return the managed connection factory.
 - 
getConnectionRequestInfopublic JCAConnectionRequestInfo getConnectionRequestInfo() Return the connection request info.
 - 
getLogWriterpublic PrintWriter getLogWriter() Get the log writer.- Specified by:
- getLogWriterin interface- javax.resource.spi.ManagedConnection
 
 - 
setLogWriterpublic void setLogWriter(PrintWriter logWriter) throws javax.resource.ResourceException Set the log writer.- Specified by:
- setLogWriterin interface- javax.resource.spi.ManagedConnection
- Throws:
- javax.resource.ResourceException
 
 - 
getConnectionpublic Object getConnection(Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance.- Specified by:
- getConnectionin interface- javax.resource.spi.ManagedConnection
- Throws:
- javax.resource.ResourceException
 
 - 
destroypublic void destroy() throws javax.resource.ResourceExceptionDestroys the physical connection to the underlying resource manager.- Specified by:
- destroyin interface- javax.resource.spi.ManagedConnection
- Throws:
- javax.resource.ResourceException
 
 - 
cleanuppublic void cleanup() throws javax.resource.ResourceExceptionApplication server calls this method to force any cleanup on the ManagedConnection instance.- Specified by:
- cleanupin interface- javax.resource.spi.ManagedConnection
- Throws:
- javax.resource.ResourceException
 
 - 
associateConnectionpublic void associateConnection(Object connection) throws javax.resource.ResourceException Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance.- Specified by:
- associateConnectionin interface- javax.resource.spi.ManagedConnection
- Throws:
- javax.resource.ResourceException
 
 - 
getXAResourcepublic XAResource getXAResource() throws javax.resource.ResourceException Returns an javax.transaction.xa.XAresource instance.- Specified by:
- getXAResourcein interface- javax.resource.spi.ManagedConnection
- Throws:
- javax.resource.ResourceException
 
 - 
getLocalTransactionpublic javax.resource.spi.LocalTransaction getLocalTransaction() throws javax.resource.ResourceExceptionReturns an javax.resource.spi.LocalTransaction instance.- Specified by:
- getLocalTransactionin interface- javax.resource.spi.ManagedConnection
- Throws:
- javax.resource.ResourceException
 
 - 
getMetaDatapublic javax.resource.spi.ManagedConnectionMetaData getMetaData() throws javax.resource.ResourceExceptionGets the metadata information for this connection's underlying EIS resource manager instance.- Specified by:
- getMetaDatain interface- javax.resource.spi.ManagedConnection
- Throws:
- javax.resource.ResourceException
 
 - 
closeHandlepublic void closeHandle(JCASessionHandle handle) Close the handle.
 - 
getSessionpublic Session getSession(JCASessionHandle handle) Return the session.
 - 
getEISProductNamepublic String getEISProductName() throws javax.resource.ResourceException Return the product name.- Specified by:
- getEISProductNamein interface- javax.resource.spi.ManagedConnectionMetaData
- Throws:
- javax.resource.ResourceException
 
 - 
getEISProductVersionpublic String getEISProductVersion() throws javax.resource.ResourceException Return the product version.- Specified by:
- getEISProductVersionin interface- javax.resource.spi.ManagedConnectionMetaData
- Throws:
- javax.resource.ResourceException
 
 - 
getMaxConnectionspublic int getMaxConnections() throws javax.resource.ResourceExceptionReturn number of max connections.- Specified by:
- getMaxConnectionsin interface- javax.resource.spi.ManagedConnectionMetaData
- Throws:
- javax.resource.ResourceException
 
 - 
getUserNamepublic String getUserName() throws javax.resource.ResourceException Return the user name.- Specified by:
- getUserNamein interface- javax.resource.spi.ManagedConnectionMetaData
- Throws:
- javax.resource.ResourceException
 
 - 
logpublic void log(String message) Log a message.
 - 
addConnectionEventListenerpublic void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener) Adds a listener.- Specified by:
- addConnectionEventListenerin interface- javax.resource.spi.ManagedConnection
 
 - 
removeConnectionEventListenerpublic void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener) Remove a listener.- Specified by:
- removeConnectionEventListenerin interface- javax.resource.spi.ManagedConnection
 
 - 
sendrrorEventpublic void sendrrorEvent(JCASessionHandle handle, Exception cause) Send connection error event.
 - 
sendTxCommittedEventpublic void sendTxCommittedEvent(JCASessionHandle handle) Send transaction committed event.
 - 
sendTxRolledbackEventpublic void sendTxRolledbackEvent(JCASessionHandle handle) Send transaction rolledback event.
 - 
sendTxStartedEventpublic void sendTxStartedEvent(JCASessionHandle handle) Send transaction started event.
 
- 
 
-