Top Description Fields Constructors Methods
javax.resource.spi

public Class ConnectionEvent

extends EventObject
Class Inheritance
Imports
javax.resource.ResourceException, java.util.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:

Author
Rahul Sharma
Version
0.5
See Also
javax.resource.spi.ConnectionEventListener

Field Summary

Modifier and TypeField and Description
public static final int
CONNECTION_CLOSED

Event notification that an application component has closed the connection

public static final int
CONNECTION_ERROR_OCCURRED

Event notification that an error occurred on the connection.

private Object
private Exception
exception

Exception associated with the ConnectionEvent instance.

protected int
id

Type of the event

public static final int
LOCAL_TRANSACTION_COMMITTED

Event notification that a Resource Manager Local Transaction was committed on the connection

public static final int
LOCAL_TRANSACTION_ROLLEDBACK

Event notification that a Resource Manager Local Transaction was rolled back on the connection

public static final int
LOCAL_TRANSACTION_STARTED

Event notification that a Resource Manager Local Transaction was started on the connection

Inherited from java.util.EventObject:
source

Constructor Summary

AccessConstructor and Description
public
ConnectionEvent(ManagedConnection
ManagedConnection that is the source of the event
source
,
int
type of the Connection event
eid
)

Construct a ConnectionEvent object.

public
ConnectionEvent(ManagedConnection
ManagedConnection that is the source of the event
source
,
int
type of the Connection event
eid
,
Exception
exception about to be thrown to the application
exception
)

Construct a ConnectionEvent object.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the connection handle. May be null
getConnectionHandle
()

Get the connection handle associated with the Managed Connection instance.

public Exception

Returns:

the exception about to be thrown.
getException
()

Get the exception.

public int
getId()

Get the type of event

public void
setConnectionHandle(Object connectionHandle)

Set the connection handle.

Inherited from java.util.EventObject:
getSourcetoString

Field Detail

CONNECTION_CLOSEDback to summary
public static final int CONNECTION_CLOSED

Event notification that an application component has closed the connection

CONNECTION_ERROR_OCCURREDback to summary
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.

connectionHandleback to summary
private Object connectionHandle
exceptionback to summary
private Exception exception

Exception associated with the ConnectionEvent instance.

idback to summary
protected int id

Type of the event

LOCAL_TRANSACTION_COMMITTEDback to summary
public static final int LOCAL_TRANSACTION_COMMITTED

Event notification that a Resource Manager Local Transaction was committed on the connection

LOCAL_TRANSACTION_ROLLEDBACKback to summary
public static final int LOCAL_TRANSACTION_ROLLEDBACK

Event notification that a Resource Manager Local Transaction was rolled back on the connection

LOCAL_TRANSACTION_STARTEDback to summary
public static final int LOCAL_TRANSACTION_STARTED

Event notification that a Resource Manager Local Transaction was started on the connection

Constructor Detail

ConnectionEventback to summary
public ConnectionEvent(ManagedConnection source, int eid)

Construct a ConnectionEvent object. Exception defaults to null.

Parameters
source:ManagedConnection

ManagedConnection that is the source of the event

eid:int

type of the Connection event

ConnectionEventback to summary
public ConnectionEvent(ManagedConnection source, int eid, Exception exception)

Construct a ConnectionEvent object.

Parameters
source:ManagedConnection

ManagedConnection that is the source of the event

eid:int

type of the Connection event

exception:Exception

exception about to be thrown to the application

Method Detail

getConnectionHandleback to summary
public Object getConnectionHandle()

Get the connection handle associated with the Managed Connection instance. Used for CONNECTION_CLOSED event.

Returns:Object

the connection handle. May be null

getExceptionback to summary
public Exception getException()

Get the exception. May be null.

Returns:Exception

the exception about to be thrown.

getIdback to summary
public int getId()

Get the type of event

setConnectionHandleback to summary
public void setConnectionHandle(Object connectionHandle)

Set the connection handle. Used for CONNECTION_CLOSED event