Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.resource.spi
Class ConnectionEvent

    java.lang.Object
      java.util.EventObject
          javax.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 contains:

- Type of connection event.
- Managed connection instance that generated the event.
- Connection handle associated with the managed connection.
- Optionally an exception indicating an error.

This class is used for the following types of notifications:

- Connection closed
- Local transaction started
- Local transaction commited
- Local transaction rolled back
- Connection error occurred

Version:
  $Revision: 1.6 $
See Also:
  Serialized Form

Field Summary
`static int` | `CONNECTION_CLOSED` Connection has been closed
`static int` | `CONNECTION_ERROR_OCCURRED` Connection error has occurred
`protected int` | `id` Type of event
`static int` | `LOCAL_TRANSACTION_COMMITTED` Local transaction has been committed
`static int` | `LOCAL_TRANSACTION_ROLLEDBACK` Local transaction has been rolled back
`static int` | `LOCAL_TRANSACTION_STARTED` Local transaction has been started

Fields inherited from class java.util.EventObject
`source`

Constructor Summary
`ConnectionEvent(ManagedConnection source, int eid)` Create a new ConnectionEvent
`ConnectionEvent(ManagedConnection source, int eid, Exception exception)` Create a new ConnectionEvent

Method Summary
`Object` | `getConnectionHandle()` Get the ConnectionHandle
`Exception` | `getException()` Get the exception
`int` | `getId()` Get the event type
`void` | `setConnectionHandle(Object connectionHandle)` Set the ConnectionHandle

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

  Connection has been closed

  See Also:
    Constant Field Values

### LOCAL_TRANSACTION_STARTED

    public static final int LOCAL_TRANSACTION_STARTED

  Local transaction has been started

  See Also:
    Constant Field Values

### LOCAL_TRANSACTION_COMMITTED

    public static final int LOCAL_TRANSACTION_COMMITTED

  Local transaction has been committed

  See Also:
    Constant Field Values

### LOCAL_TRANSACTION_ROLLEDBACK

    public static final int LOCAL_TRANSACTION_ROLLEDBACK

  Local transaction has been rolled back

  See Also:
    Constant Field Values

### CONNECTION_ERROR_OCCURRED

    public static final int CONNECTION_ERROR_OCCURRED

  Connection error has occurred

  See Also:
    Constant Field Values

### id

    protected int id

  Type of event

Constructor Detail

### ConnectionEvent

    public ConnectionEvent(ManagedConnection source,
                           int eid)

  Create a new ConnectionEvent

Parameters:
  `source` - the source of the event
  `eid` - the event id

### ConnectionEvent

    public ConnectionEvent(ManagedConnection source,
                           int eid,
                           Exception exception)

  Create a new ConnectionEvent

Parameters:
  `source` - the source of the event
  `eid` - the event id
  `exception` - the exception associated with the event

Method Detail

### getId

    public int getId()

  Get the event type

  Returns:
    the event id

### getException

    public Exception getException()

  Get the exception

  Returns:
    the exception

### setConnectionHandle

    public void setConnectionHandle(Object connectionHandle)

  Set the ConnectionHandle

  Parameters:
    `connectionHandle` - the connection handle

### getConnectionHandle

    public Object getConnectionHandle()

  Get the ConnectionHandle

  Returns:
    the connection handle

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.