snaq.util
Class ObjectPoolEvent

java.lang.Object
  extended by java.util.EventObject
      extended by snaq.util.ObjectPoolEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConnectionPoolEvent

public class ObjectPoolEvent
extends EventObject

Event for ObjectPool instances. Convenience methods are available for determining the type fo the event, and the event is capable of keeping shadow copies of the pool's vital parameters at the time the event was issued, for reference to listeners.

Author:
Giles Winstanley
See Also:
Serialized Form

Field Summary
static int CHECKIN
           
static int CHECKOUT
           
static int INIT_COMPLETED
           
static int MAX_POOL_LIMIT_EXCEEDED
           
static int MAX_POOL_LIMIT_REACHED
           
static int MAX_SIZE_LIMIT_ERROR
           
static int MAX_SIZE_LIMIT_REACHED
           
static int PARAMETERS_CHANGED
           
static int POOL_FLUSHED
           
static int POOL_RELEASED
           
static int VALIDATION_ERROR
           
 
Constructor Summary
ObjectPoolEvent(ObjectPool pool, int type)
          Creates a new PoolEvent.
 
Method Summary
 int getCheckedOut()
           
 int getFreeCount()
           
 long getIdleTimeout()
           
 int getMaxPool()
           
 int getMaxSize()
           
 int getMinPool()
           
 ObjectPool getPool()
          Returns the pool for which this event was created.
 float getPoolHitRate()
           
 int getSize()
           
 int getType()
          Returns the type of event this object represents.
 String getTypeString()
          Returns the type of event this object represents as a string.
 boolean isMaxPoolLimitExceeded()
           
 boolean isMaxPoolLimitReached()
           
 boolean isMaxSizeLimitError()
           
 boolean isMaxSizeLimitReached()
           
 boolean isPoolCheckIn()
           
 boolean isPoolCheckOut()
           
 boolean isPoolFlushed()
           
 boolean isPoolInitCompleted()
           
 boolean isPoolParametersChanged()
           
 boolean isPoolReleased()
           
 boolean isValidationError()
           
 String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INIT_COMPLETED

public static final int INIT_COMPLETED
See Also:
Constant Field Values

CHECKOUT

public static final int CHECKOUT
See Also:
Constant Field Values

CHECKIN

public static final int CHECKIN
See Also:
Constant Field Values

VALIDATION_ERROR

public static final int VALIDATION_ERROR
See Also:
Constant Field Values

MAX_POOL_LIMIT_REACHED

public static final int MAX_POOL_LIMIT_REACHED
See Also:
Constant Field Values

MAX_POOL_LIMIT_EXCEEDED

public static final int MAX_POOL_LIMIT_EXCEEDED
See Also:
Constant Field Values

MAX_SIZE_LIMIT_REACHED

public static final int MAX_SIZE_LIMIT_REACHED
See Also:
Constant Field Values

MAX_SIZE_LIMIT_ERROR

public static final int MAX_SIZE_LIMIT_ERROR
See Also:
Constant Field Values

PARAMETERS_CHANGED

public static final int PARAMETERS_CHANGED
See Also:
Constant Field Values

POOL_FLUSHED

public static final int POOL_FLUSHED
See Also:
Constant Field Values

POOL_RELEASED

public static final int POOL_RELEASED
See Also:
Constant Field Values
Constructor Detail

ObjectPoolEvent

public ObjectPoolEvent(ObjectPool pool,
                       int type)
Creates a new PoolEvent.

Method Detail

getPool

public ObjectPool getPool()
Returns the pool for which this event was created.


getType

public int getType()
Returns the type of event this object represents.


getTypeString

public String getTypeString()
Returns the type of event this object represents as a string.


toString

public String toString()
Overrides:
toString in class EventObject

isPoolInitCompleted

public boolean isPoolInitCompleted()

isPoolCheckOut

public boolean isPoolCheckOut()

isPoolCheckIn

public boolean isPoolCheckIn()

isValidationError

public boolean isValidationError()

isMaxPoolLimitReached

public boolean isMaxPoolLimitReached()

isMaxPoolLimitExceeded

public boolean isMaxPoolLimitExceeded()

isMaxSizeLimitReached

public boolean isMaxSizeLimitReached()

isMaxSizeLimitError

public boolean isMaxSizeLimitError()

isPoolParametersChanged

public boolean isPoolParametersChanged()

isPoolFlushed

public boolean isPoolFlushed()

isPoolReleased

public boolean isPoolReleased()

getMinPool

public int getMinPool()

getMaxPool

public int getMaxPool()

getMaxSize

public int getMaxSize()

getIdleTimeout

public long getIdleTimeout()

getCheckedOut

public int getCheckedOut()

getFreeCount

public int getFreeCount()

getSize

public int getSize()

getPoolHitRate

public float getPoolHitRate()