ConnectionEvent (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.resource.spi Class ConnectionEvent

java.lang.Object
  extended by java.util.EventObject
      extended by javax.resource.spi.ConnectionEvent
所有已实现的接口:
Serializable

public class ConnectionEvent
extends EventObject

The ConnectionEvent class provides information about the source of a connection related event.A ConnectionEvent instance contains the following information:

  • Type of the connection event
  • ManagedConnection instance that generated the connection event. A ManagedConnection instance is returned from the method ConnectionEvent.getSource.
  • Connection handle associated with the ManagedConnection instance; required for the CONNECTION_CLOSED event and optional for the other event types.
  • Optionally, an exception indicating the connection related error. Note that exception is used for CONNECTION_ERROR_OCCURRED.

This class defines following types of event notifications:

  • CONNECTION_CLOSED
  • LOCAL_TRANSACTION_STARTED
  • LOCAL_TRANSACTION_COMMITTED
  • LOCAL_TRANSACTION_ROLLEDBACK
  • CONNECTION_ERROR_OCCURRED

版本:
0.5
作者:
Rahul Sharma
另请参见:
ConnectionEventListener, Serialized Form

字段摘要
static int CONNECTION_CLOSED
          Event notification that an application component has closed the connection
static int CONNECTION_ERROR_OCCURRED
          Event notification that an error occurred on the connection.
protected  int id
          Type of the event
static int LOCAL_TRANSACTION_COMMITTED
          Event notification that a Resource Manager Local Transaction was committed on the connection
static int LOCAL_TRANSACTION_ROLLEDBACK
          Event notification that a Resource Manager Local Transaction was rolled back on the connection
static int LOCAL_TRANSACTION_STARTED
          Event notification that a Resource Manager Local Transaction was started on the connection
 
Fields inherited from class java.util.EventObject
source
 
构造器摘要
ConnectionEvent(ManagedConnection source, int eid)
          Construct a ConnectionEvent object.
ConnectionEvent(ManagedConnection source, int eid, Exception exception)
          Construct a ConnectionEvent object.
 
方法摘要
 Object getConnectionHandle()
          Get the connection handle associated with the Managed Connection instance.
 Exception getException()
          Get the exception.
 int getId()
          Get the type of event
 void setConnectionHandle(Object connectionHandle)
          Set the connection handle.
 
类方法继承 java.util.EventObject
getSource, toString
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

CONNECTION_CLOSED

public static final int CONNECTION_CLOSED
Event notification that an application component has closed the connection

另请参见:
常量字段


LOCAL_TRANSACTION_STARTED

public static final int LOCAL_TRANSACTION_STARTED
Event notification that a Resource Manager Local Transaction was started on the connection

另请参见:
常量字段


LOCAL_TRANSACTION_COMMITTED

public static final int LOCAL_TRANSACTION_COMMITTED
Event notification that a Resource Manager Local Transaction was committed on the connection

另请参见:
常量字段


LOCAL_TRANSACTION_ROLLEDBACK

public static final int LOCAL_TRANSACTION_ROLLEDBACK
Event notification that a Resource Manager Local Transaction was rolled back on the connection

另请参见:
常量字段


CONNECTION_ERROR_OCCURRED

public static final int CONNECTION_ERROR_OCCURRED
Event notification that an error occurred on the connection. This event indicates that the ManagedConnection instance is now invalid and unusable.

另请参见:
常量字段


id

protected int id
Type of the event

构造器详细信息

ConnectionEvent

public ConnectionEvent(ManagedConnection source,
                       int eid)
Construct a ConnectionEvent object. Exception defaults to null.

参数:
source - ManagedConnection that is the source of the event
eid - type of the Connection event


ConnectionEvent

public ConnectionEvent(ManagedConnection source,
                       int eid,
                       Exception exception)
Construct a ConnectionEvent object.

参数:
source - ManagedConnection that is the source of the event
exception - exception about to be thrown to the application
eid - type of the Connection event

方法详细信息

getConnectionHandle

public Object getConnectionHandle()
Get the connection handle associated with the Managed Connection instance. Used for CONNECTION_CLOSED event.

返回:
the connection handle. May be null

setConnectionHandle

public void setConnectionHandle(Object connectionHandle)
Set the connection handle. Used for CONNECTION_CLOSED event


getException

public Exception getException()
Get the exception. May be null.

返回:
the exception about to be thrown.

getId

public int getId()
Get the type of event


Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.