Name
ConnectionEvent
Synopsis
A ConnectionEvent
represents an event related to a ManagedConnection
. The types of events supported include the closing of a connection, an
error on a connection, and the start, commit or rollback of a
LocalTransaction
associated with the connection. Resource adapters
receive these events by registering a ConnectionEventListener
with a
ManagedConnection
using its addConnectionEventListener()
method.
public class ConnectionEvent extends java.util.EventObject { // Public Constructors public ConnectionEvent(ManagedConnection source, int eid); public ConnectionEvent(ManagedConnection source, int eid, Exception exception); // Public Constants public static final int CONNECTION_CLOSED; // =1 public static final int CONNECTION_ERROR_OCCURRED; // =5 public static final int LOCAL_TRANSACTION_COMMITTED; // =3 public static final int LOCAL_TRANSACTION_ROLLEDBACK; // =4 public static final int LOCAL_TRANSACTION_STARTED; // =2 // Public Instance Methods public Object getConnectionHandle(); public Exception getException(); public int getId(); public void setConnectionHandle( Object connectionHandle); // Protected Instance Fields protected int id; }
Passed To
javax.resource.spi.ConnectionEventListener.{connectionClosed()
, connectionErrorOccurred()
, localTransactionCommitted()
, localTransactionRolledback()
, localTransactionStarted()}
Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.