站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Java Platform, Enterprise Edition v1.4 API Specifications

ConnectionEvent (Java 2 Platform Ent. Ed. v1.4) - Java Platform, Enterprise Edition v1.4 API Specifications

JavaTM 2 Platform
Ent. Ed. v1.4

javax.resource.spi
Class ConnectionEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjavax.resource.spi.ConnectionEvent
All Implemented Interfaces:
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:

This class defines following types of event notifications:

Version:
0.5
Author:
Rahul Sharma
See Also:
ConnectionEventListener, Serialized Form

Field Summary
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
 
Constructor Summary
ConnectionEvent(ManagedConnection source, int eid)
          Construct a ConnectionEvent object.
ConnectionEvent(ManagedConnection source, int eid, Exception exception)
          Construct a ConnectionEvent object.
 
Method Summary
 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.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONNECTION_CLOSED

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

See Also:
Constant Field Values

LOCAL_TRANSACTION_STARTED

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

See Also:
Constant Field Values

LOCAL_TRANSACTION_COMMITTED

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

See Also:
Constant Field Values

LOCAL_TRANSACTION_ROLLEDBACK

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

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

id

protected int id
Type of the event

Constructor Detail

ConnectionEvent

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

Parameters:
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.

Parameters:
source - ManagedConnection that is the source of the event
exception - exception about to be thrown to the application
eid - type of the Connection event
Method Detail

getConnectionHandle

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

Returns:
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.

Returns:
the exception about to be thrown.

getId

public int getId()
Get the type of event


JavaTM 2 Platform
Ent. Ed. v1.4

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.