|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.connector2.hod.J2HODManagedConnection
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 detail on the XAResource interface are described in the JTA specification.
The LocalTransaction interface is used by the application server to manage local transactions.
Field Summary | |
static int |
PS_SIZE_24X132
|
static int |
PS_SIZE_24X80
|
static int |
PS_SIZE_27X132
|
static int |
PS_SIZE_32X80
|
static int |
PS_SIZE_43X80
|
Constructor Summary | |
J2HODManagedConnection()
Creates an instance of J2HODManagedConnection. |
|
J2HODManagedConnection(javax.resource.spi.ManagedConnectionFactory aFactory,
javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo requestInfo,
java.util.Properties prop,
java.lang.String aUserName,
java.lang.String aPassword)
Creates an instance of J2HODManagedConnection. |
Method Summary | |
void |
addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Adds a connection event listener to the ManagedConnection instance. |
void |
associateConnection(java.lang.Object handle)
Used by the container to change the association of an application-level connection handle with a ManagedConnection instance. |
void |
cleanup()
Application server calls this method to force any cleanup on the ManagedConnection instance. |
void |
destroy()
Destroys the physical connection to the underlying resource manager. |
java.lang.Object |
getConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo requestInfo)
Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance. |
javax.resource.spi.LocalTransaction |
getLocalTransaction()
Returns a javax.resource.spi.LocalTransaction instance. |
java.io.PrintWriter |
getLogWriter()
getLogWriter method comment. |
javax.resource.spi.ManagedConnectionMetaData |
getMetaData()
Gets the metadata information for this connection's underlying EIS resource manager instance. |
javax.transaction.xa.XAResource |
getXAResource()
Returns an javax.transaction.xa.XAresource instance. |
boolean |
isDirty()
Indicatates whether there have been an error or not. |
boolean |
isLoggedOn()
Indicates whether this connection is logged on or not. |
boolean |
isReauthentication()
Indicates whether is is a reauthentication or not. |
void |
removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Removes connection event listener. |
void |
setLogWriter(java.io.PrintWriter out)
Sets log-writer output. |
void |
setReauthentication(boolean newReauthentication)
Specifies whether to reauthenticate or not. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PS_SIZE_24X80
public static final int PS_SIZE_32X80
public static final int PS_SIZE_43X80
public static final int PS_SIZE_27X132
public static final int PS_SIZE_24X132
Constructor Detail |
public J2HODManagedConnection()
public J2HODManagedConnection(javax.resource.spi.ManagedConnectionFactory aFactory, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo requestInfo, java.util.Properties prop, java.lang.String aUserName, java.lang.String aPassword) throws javax.resource.ResourceException
aFactory
- ManagedConnectionFactorysubject
- javax.security.auth.SubjectrequestInfo
- ConnectionRequestInfoprop
- java.util.PropertiesaUserName
- java.lang.StringaPassword
- java.lang.Stringjavax.resource.ResourceException
- Method Detail |
public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
addConnectionEventListener
in interface javax.resource.spi.ManagedConnection
listener
- javax.resource.spi.ConnectionEventListener - a new ConnectionEventListener to be registeredpublic void associateConnection(java.lang.Object handle) throws javax.resource.ResourceException
The resource adapter is required to implement the associateConnection method. The method implementation for a ManagedConnection should dissociate the connection handle (passed as a parameter) from its currently associated ManagedConnection and associate the new connection handle with itself.
associateConnection
in interface javax.resource.spi.ManagedConnection
handle
- java.lang.Objectpublic void cleanup() throws javax.resource.ResourceException
The method ManagedConnection cleanup initiates a cleanup of any client-specific state as maintained by a ManagedConnection instance. The cleanup should invalidate all connection handles that had been created using this ManagedConnection instance. Any attempt by an application component to use the connection handle after cleanup of the underlying ManagedConnection should result in an exception.
The cleanup of ManagedConnection is always driven by an application server. An appliation server should not invoke ManagedConnection.cleanup() when there is an uncompleted transaction (associated with ManagedConnection instance) in progress.
The invocation of ManagedConnection cleanup method on an already cleaned-up connection should not throw an exception.
The cleanup of ManagedConnection instance resets its client specific state and prepares the connection to be put back in to a connection pool. The cleanup method should not cause resource adapter to close the physical pipe and reclaim system resources associated with the physical connection.
cleanup
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- - generic exception if operation failspublic void destroy() throws javax.resource.ResourceException
To manage the isze of the connection pool, an application server can explicitly call ManagedConnection destroy to destroy a physical connection. A resource adapter should destroy all allocated system resources for this ManagedConnection instance when the method destroy is called.
destroy
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- - generic exception if operation failedpublic java.lang.Object getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo requestInfo) throws javax.resource.ResourceException
The ManagedConnection uses the Subject and additional ConnectionRequest Info (which is specific to resource adapter and opaque to application server) to set the state of the physical connection.
getConnection
in interface javax.resource.spi.ManagedConnection
subject
- javax.security.auth.Subject - security context as JAAS subjectrequestInfo
- ConnectionRequestInfopublic javax.resource.spi.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException
getLocalTransaction
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- - generic exception if operation failspublic java.io.PrintWriter getLogWriter() throws javax.resource.ResourceException
getLogWriter
in interface javax.resource.spi.ManagedConnection
public javax.resource.spi.ManagedConnectionMetaData getMetaData() throws javax.resource.ResourceException
getMetaData
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- - generic exception if operation failspublic javax.transaction.xa.XAResource getXAResource() throws javax.resource.ResourceException
getXAResource
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- - generic exception if operation failspublic boolean isDirty()
public boolean isLoggedOn()
public boolean isReauthentication()
public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
removeConnectionEventListener
in interface javax.resource.spi.ManagedConnection
listener
- javax.resource.spi.ConnectionEventListenerpublic void setLogWriter(java.io.PrintWriter out) throws javax.resource.ResourceException
setLogWriter
in interface javax.resource.spi.ManagedConnection
out
- java.io.PrintWriter - logwriter outputjavax.resource.ResourceException
- public void setReauthentication(boolean newReauthentication)
newReauthentication
- boolean - true if setting to reauthenticate; false otherwise.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |