|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ManagedConnection
ManagedConnection instance represents a physical connection to
the underlying EIS.
A ManagedConnection instance provides access to a pair of interfaces:
javax.transaction.xa.XAResource and javax.resource.spi.LocalTransaction.
XAResource interface is used by the transaction manager to associate
and dissociate a transaction with the underlying EIS resource manager
instance and to perform two-phase commit protocol. The ManagedConnection
interface is not directly used by the transaction manager. More details
on the XAResource interface are described in the JTA specification.
The LocalTransaction interface is used by the application server to
manage local transactions.
| Method Summary | |
|---|---|
void |
addConnectionEventListener(ConnectionEventListener listener)
Adds a connection event listener to the ManagedConnection instance. The registered ConnectionEventListener instances are notified of connection close and error events, also of local transaction related events on the Managed Connection. |
void |
associateConnection(Object connection)
Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance. |
void |
cleanup()
Application server calls this method to force any cleanup on the ManagedConnection instance. The method ManagedConnection.cleanup initiates a cleanup of the any client-specific state as maintained by a ManagedConnection instance. |
void |
destroy()
Destroys the physical connection to the underlying resource manager. To manage the size of the connection pool, an application server can explictly call ManagedConnection.destroy to destroy a physical connection. |
Object |
getConnection(Subject subject,
ConnectionRequestInfo cxRequestInfo)
Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance. |
LocalTransaction |
getLocalTransaction()
Returns an javax.resource.spi.LocalTransaction instance. |
PrintWriter |
getLogWriter()
Gets the log writer for this ManagedConnection instance. The log writer is a character output stream to which all logging and tracing messages for this ManagedConnection instance will be printed. |
ManagedConnectionMetaData |
getMetaData()
Gets the metadata information for this connection's underlying EIS resource manager instance. |
XAResource |
getXAResource()
Returns an javax.transaction.xa.XAresource instance. |
void |
removeConnectionEventListener(ConnectionEventListener listener)
Removes an already registered connection event listener from the ManagedConnection instance. |
void |
setLogWriter(PrintWriter out)
Sets the log writer for this ManagedConnection instance. The log writer is a character output stream to which all logging and tracing messages for this ManagedConnection instance will be printed. |
| Method Detail |
|---|
Object getConnection(Subject subject,
ConnectionRequestInfo cxRequestInfo)
throws ResourceException
subject - security context as JAAS subjectcxRequestInfo - ConnectionRequestInfo instance
ResourceException - generic exception if operation fails
ResourceAdapterInternalException - resource adapter internal
error condition
SecurityException - security related error condition
CommException - failed communication with EIS instance
EISSystemException - internal error condition in EIS instance
- used if EIS instance is involved in setting state of
ManagedConnection
void destroy()
throws ResourceException
ResourceException - generic exception if operation failed
IllegalStateException - illegal state for destroying connection
void cleanup()
throws ResourceException
ResourceException - generic exception if operation fails
ResourceAdapterInternalException - resource adapter internal
error condition
IllegalStateException - Illegal state for calling connection
cleanup. Example - if a localtransaction is in progress
that doesn't allow connection cleanup
void associateConnection(Object connection)
throws ResourceException
connection - Application-level connection handle
ResourceException - Failed to associate the connection handle
with this ManagedConnection instance
IllegalStateException - Illegal state for invoking this method
ResourceAdapterInternalException - Resource adapter internal
error conditionvoid addConnectionEventListener(ConnectionEventListener listener)
listener - a new ConnectionEventListener to be registeredvoid removeConnectionEventListener(ConnectionEventListener listener)
listener - already registered connection event listener to be removed
XAResource getXAResource()
throws ResourceException
ResourceException - generic exception if operation fails
NotSupportedException - if the operation is not supported
ResourceAdapterInternalException - resource adapter internal error condition
LocalTransaction getLocalTransaction()
throws ResourceException
ResourceException - generic exception if operation fails
NotSupportedException - if the operation is not supported
ResourceAdapterInternalException - resource adapter internal error condition
ManagedConnectionMetaData getMetaData()
throws ResourceException
ResourceException - generic exception if operation fails
NotSupportedException - if the operation is not supported
void setLogWriter(PrintWriter out)
throws ResourceException
out - Character Output stream to be associated
ResourceException - generic exception if operation fails
ResourceAdapterInternalException - resource adapter related
error condition
PrintWriter getLogWriter()
throws ResourceException
ResourceException - generic exception if operation fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||