planetj.database.connection
Class ConnectionEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byplanetj.database.connection.ConnectionEvent
All Implemented Interfaces:
java.io.Serializable

public final class ConnectionEvent
extends java.util.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
static int ROW_DELETE_STATEMENT
          A connection is about to be used to delete rows
static int ROW_INSERT_STATEMENT
          A connection is about to be used to insert rows
static int ROW_UPDATE_STATEMENT
          A connection is about to be used to update rows
static int UNKNOWN_TYPE
          An unknown event type
 
Fields inherited from class java.util.EventObject
source
 
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).
static int getEventType(SQLContext context)
          Gets the correct event type for the SQLContext
 ConnectionEvent getOriginatingEvent()
          Gets the event which caused this event (if such an event exists).
 int getType()
          Gets the type of event that occured.
protected  void setOriginatingEvent(ConnectionEvent newOriginatingEvent)
          Sets the originating event
 
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

UNKNOWN_TYPE

public static final int UNKNOWN_TYPE
An unknown event type

See Also:
Constant Field Values

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

ROW_DELETE_STATEMENT

public static final int ROW_DELETE_STATEMENT
A connection is about to be used to delete rows

See Also:
Constant Field Values

ROW_INSERT_STATEMENT

public static final int ROW_INSERT_STATEMENT
A connection is about to be used to insert rows

See Also:
Constant Field Values

ROW_UPDATE_STATEMENT

public static final int ROW_UPDATE_STATEMENT
A connection is about to be used to update rows

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).


getEventType

public static int getEventType(SQLContext context)
Gets the correct event type for the SQLContext


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.


setOriginatingEvent

protected void setOriginatingEvent(ConnectionEvent newOriginatingEvent)
Sets the originating event