planetj.database.connection
Class ConnectionEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--planetj.database.connection.ConnectionEvent
All Implemented Interfaces:
Serializable

public final class ConnectionEvent
extends EventObject

Contains information about an event involving a connection. The source of a ConnectionEvent is the connection involved with the event.

See Also:
Serialized Form

Field Summary
static int CONNECTION_CHECK_IN
          A connection is about to be checked into the connection pool
static int CONNECTION_CHECK_OUT
          A connection is about to be checked out of the connection pool.
static int CONNECTION_CREATE
          A connection is about to be created.
static int CONNECTION_ORPHAN
          A connection is about to be orphaned
static int CONNECTION_TIMEOUT
          A connection is about to be timed out
 
Constructor Summary
ConnectionEvent(DataEngineConnection source, int type)
          Creates a new ConnectionEvent
 
Method Summary
 DataEngineConnection getConnection()
          Gets the connection associated with the event (this will be null only if the event is the creation or destruction of an entire connection pool).
 ConnectionEvent getOriginatingEvent()
          Gets the event which caused this event (if such an event exists).
 int getType()
          Gets the type of event that occured.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONNECTION_CREATE

public static final int CONNECTION_CREATE
A connection is about to be created.

See Also:
Constant Field Values

CONNECTION_CHECK_OUT

public static final int CONNECTION_CHECK_OUT
A connection is about to be checked out of the connection pool.

See Also:
Constant Field Values

CONNECTION_CHECK_IN

public static final int CONNECTION_CHECK_IN
A connection is about to be checked into the connection pool

See Also:
Constant Field Values

CONNECTION_ORPHAN

public static final int CONNECTION_ORPHAN
A connection is about to be orphaned

See Also:
Constant Field Values

CONNECTION_TIMEOUT

public static final int CONNECTION_TIMEOUT
A connection is about to be timed out

See Also:
Constant Field Values
Constructor Detail

ConnectionEvent

public ConnectionEvent(DataEngineConnection source,
                       int type)
Creates a new ConnectionEvent

Method Detail

getConnection

public DataEngineConnection getConnection()
Gets the connection associated with the event (this will be null only if the event is the creation or destruction of an entire connection pool).


getOriginatingEvent

public ConnectionEvent getOriginatingEvent()
Gets the event which caused this event (if such an event exists). For example, if this event type is CONNECTION_CREATE and the connection is being created because a different connection had timed out, then the originating event would be the CONNECTION_TIMEOUT event for the timeout. If the connection was instead created just because more connections were needed in the connection pool, then there would be no originating event.


getType

public int getType()
Gets the type of event that occured. This will be one of the constants defined in the class.