ManagedConnection
public interface javax.resource.spi.ManagedConnection
- Note:
- Normally, applications do not use this class; it is intended for use by implementations of ConnectionManager.
WebSphere MQ classes for Java provides an implementation of ManagedConnection that is returned from ManagedConnectionFactory.createManagedConnection. This object represents a connection to a WebSphere MQ Queue Manager. For more details about this interface, see the J2EE Connector Architecture specification (refer to Sun's Web site at http://java.sun.com).
Methods
- addConnectionEventListener
public void addConnectionEventListener ConnectionEventListener(listener)Adds a ConnectionEventListener to the ManagedConnection instance.
The listener is notified if a severe error occurs on the ManagedConnection, or when MQQueueManager.disconnect() is called on a connection handle that is associated with this ManagedConnection. The listener is not notified about local transaction events (see getLocalTransaction).
- associateConnection
public void associateConnection(Object connection)Throws ResourceException.
WebSphere MQ classes for Java does not currently support this method. A javax.resource.NotSupportedException is thrown.
- cleanup
public void cleanup()Throws ResourceException.
Closes all open connection handles, and resets the physical connection to an initial state ready to be pooled. Any pending local transaction is rolled back. For more details, see getLocalTransaction.
- destroy
public void destroy()Throws ResourceException.
Destroys the physical connection to the WebSphere MQ Queue Manager. Any pending local transaction is committed. For more details, see getLocalTransaction.
- getConnection
public Object getConnection javax.security.auth.Subject(subject, ConnectionRequestInfo cxRequestInfo)Throws ResourceException.
Creates a new connection handle for the physical connection represented by the ManagedConnection object. For WebSphere MQ classes for Java, this returns an MQQueueManager object. The ConnectionManager normally returns this object from allocateConnection.
The subject parameter is ignored. If the cxRequestInfo parameter is not suitable, a ResourceException is thrown. Multiple connection handles can be used simultaneously for each single ManagedConnection.
- getLocalTransaction
public LocalTransaction getLocalTransaction()Throws ResourceException.
WebSphere MQ classes for Java does not currently support this method. A javax.resource.NotSupportedException is thrown.
Currently, a ConnectionManager cannot manage the WebSphere MQ local transaction, and registered ConnectionEventListeners are not informed about events relating to the local transaction. When cleanup() occurs, any ongoing unit of work is rolled back. When destroy() occurs, any ongoing unit of work is committed.
Existing API behavior is that an ongoing unit of work is committed at MQQueueManager.disconnect(). This existing behavior is preserved only when an MQConnectionManager (rather than a ConnectionManager) manages the connection.
- getLogWriter
public java.io.PrintWriter getLogWriter()Throws ResourceException.
Returns the log writer for this ManagedConnection.
WebSphere MQ classes for Java does not currently use the log writer. See MQException.log for more information about logging.
- getMetaData
public ManagedConnectionMetaData getMetaData()Throws ResourceException.
Gets the meta data information for the underlying Queue Manager. See ManagedConnectionMetaData.
- getXAResource
public javax.transaction.xa.XAResource getXAResource()Throws ResourceException.
WebSphere MQ classes for Java does not currently support this method. A javax.resource.NotSupportedException is thrown.
- removeConnectionEventListener
public void removeConnectionEventListener ConnectionEventListener(listener)Removes a registered ConnectionEventListener.
- setLogWriter
public void setLogWriter java.io.PrintWriter(out)Throws ResourceException.
Sets the log writer for this ManagedConnection. When a ManagedConnection is created, it inherits the log writer from its ManagedConnectionFactory.
WebSphere MQ classes for Java does not currently use the log writer. See MQException.log for more information about logging.
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.