java.lang.Object com.ibm.connector2.ims.ico.IMSManagedConnection
public abstract class IMSManagedConnection
implements ManagedConnection
extends Object
An IMSManagedConnection is an abstract class for the IMS managed connection that represents a physical connection to IMS via IMS Connect. This class contains methods and properties for handling generic (non-communication-protocol specific) connection interactions with IMS Connect.
Java applications using the Common Client Interface (CCI) do not directly reference IMSManagedConnection.
Method | Description |
---|---|
void addConnectionEventListener(ConnectionEventListener) | Used by the application server to register a listener interested in receiving notification of events associated with this IMSManagedConnection instance. |
void associateConnection(Object) | Associates a connection handle with an IMSManagedConnection instance. |
void cleanup() | Called by the application server to clean up any client-specific state data maintained by an IMSManagedConnection instance and put the IMSManagedConnection instance back in the pool. |
void destroy() | Closes the physical connection and releases all system resources held by the associated IMSManagedConnection instance. |
Object getConnection(Subject, ConnectionRequestInfo) | Called by the application server to create a new application-level handle to an object that represents an underlying physical connection (an IMSManagedConnection instance). |
LocalTransaction getLocalTransaction() | Returns a javax.resource.spi.LocalTransaction instance that enables the application server to manage local transactions for the resource manager. |
PrintWriter getLogWriter() | Returns a reference to the logWriter to allow the client application to write messages to the trace log. |
ManagedConnectionMetaData getMetaData() | Returns the IMSMangedConnectionMetaData instance which contains information about the associated IMSManagedConnection instance. |
Integer getTraceLevel() | Returns the value of the traceLevel property. |
XAResource getXAResource() | Returns a javax.transaction.xa.XAResource instance that enables the application server to demarcate global transactions with a resource manager . |
void removeConnectionEventListener(ConnectionEventListener) | The application server uses the removeConnectionEventListener method to remove a connection listener from an IMSManagedConnection instance. |
void setLogWriter(PrintWriter) | Sets the value of the logWriter property. |
void setTraceLevel(Integer) | Sets the value of the traceLevel property. |
public void addConnectionEventListener(ConnectionEventListener aListener)Used by the application server to register a listener interested in receiving notification of events associated with this IMSManagedConnection instance.
- Parameters
- aListener - An interested listener (the application server.)
public void associateConnection(Object handle) throws ResourceException
Associates a connection handle with an IMSManagedConnection instance. In the case of "smart handles" support, associateConnection is invoked by the connection manager during ConnectionManager.associateConnection() processing so that the connection handle can return to the active state.
- Parameters
- handle - A connection handle.
- Throws
ResourceException
If handle passed is not of type IMSConnection.
public void cleanup() throws ResourceException
Called by the application server to clean up any client-specific state data maintained by an IMSManagedConnection instance and put the IMSManagedConnection instance back in the pool. This includes invalidating all connection handles associated with the instance. The application server calls cleanup() after the end of a connection sharing scope or when the last associated connection handle is closed for an IMSManagedConnection instance.
The cleanup() method does not close the physical connection (for example, a TCP/IP socket) to IMS Connect.
- Throws
ResourceException
A problem was encountered while resetting the state of this IMSManagedConnection instance.
public void destroy() throws ResourceExceptionCloses the physical connection and releases all system resources held by the associated IMSManagedConnection instance. It is called by the application server:
- To manage the size of the connection pool
- To disconnect when it receives a connection error event indicating a fatal error on the physical connection
- Throws
ResourceException
If problems were encountered in closing the connection.
public Object getConnection(Subject aSubject, ConnectionRequestInfo aConnectionRequestInfo) throws ResourceException
Called by the application server to create a new application-level handle to an object that represents an underlying physical connection (an IMSManagedConnection instance).
This method may be called by the application server to re-authenticate a physical connection (when the physical connection already exists in the pool under a different security context.) Re-authentication is allowed if no active connection handles are currently associated with the IMSManagedConnection instance. With re-authentication, the getConnection method changes the security context of the underlying IMS managed connection instance and returns a new connection handle in the form of an IMSConnection instance.
- Parameters
- aSubject - Security information for container-managed EIS sign-on.
- aConnectionRequestInfo - Security information for component-managed EIS sign-on.
- Returns
- A new IMSConnection instance.
- Throws
ResourceException
An internal problem was encountered while executing the getConnection method.
public LocalTransaction getLocalTransaction() throws ResourceExceptionReturns a javax.resource.spi.LocalTransaction instance that enables the application server to manage local transactions for the resource manager.
- Returns
- A LocalTransaction instance.
- See Also
public PrintWriter getLogWriter()Returns a reference to the logWriter to allow the client application to write messages to the trace log.
- Returns
- The logWriter property value.
- See Also
public ManagedConnectionMetaData getMetaData() throws ResourceExceptionReturns the IMSMangedConnectionMetaData instance which contains information about the associated IMSManagedConnection instance.
- Returns
- The IMSMangedConnectionMetaData instance.
public Integer getTraceLevel()Returns the value of the traceLevel property. The traceLevel value determines the level of detail written to the trace log.
- Returns
- The trace level of the IMS managed connection instance.
- See Also
public XAResource getXAResource() throws ResourceExceptionReturns a javax.transaction.xa.XAResource instance that enables the application server to demarcate global transactions with a resource manager .
An application server enlists this XAResource instance with a transaction manager if the ManagedConnection instance is used in a JTA transaction that is coordinated by the transaction manager.
- Returns
- An XAResource instance.
- See Also
public void removeConnectionEventListener(ConnectionEventListener aListener)The application server uses the removeConnectionEventListener method to remove a connection listener from an IMSManagedConnection instance.
- Parameters
- javax.resource.spi.ConnectionEventListener - The listener to be removed.
public void setLogWriter(PrintWriter aLogWriter) throws ResourceExceptionSets the value of the logWriter property. A log writer is a character output stream to which all logging and tracing messages are printed.
- Parameters
- aLogWriter - The new value for the logWriter property.
- See Also
public void setTraceLevel(Integer aTraceLevel)Sets the value of the traceLevel property.
- Parameters
- aTraceLevel - The new value for the traceLevel property.
- See Also