Package com.sun.enterprise.resource.pool
Class PoolLifeCycleListenerRegistry
- java.lang.Object
-
- com.sun.enterprise.resource.pool.PoolLifeCycleListenerRegistry
-
- All Implemented Interfaces:
PoolLifeCycleListener
public class PoolLifeCycleListenerRegistry extends Object implements PoolLifeCycleListener
Implementation of PoolLifeCycleListener to listen to events related to a connection pool. The registry allows multiple listeners (ex: pool monitoring) to listen to the pool's lifecyle. Maintains a list of listeners for this pool identified by poolName.- Author:
- Shalini M
-
-
Field Summary
Fields Modifier and Type Field Description protected List<PoolLifeCycleListener>poolListenersList
-
Constructor Summary
Constructors Constructor Description PoolLifeCycleListenerRegistry(PoolInfo poolInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectionAcquired(long resourceHandleId)indicates that a connection is acquired by applicationvoidconnectionCreated()indicates that a new connection is createdvoidconnectionDestroyed(long resourceHandleId)indicates that a connection is destroyedvoidconnectionMatched()indicates that a connection under test matches the current requestvoidconnectionNotMatched()indicates that a connection under test does not match the current requestvoidconnectionReleased(long resourceHandleId)indicates that a connection is releasedvoidconnectionRequestDequeued()indicates that the wait queue length has decreased.voidconnectionRequestQueued()indicates that the wait queue length has increased.voidconnectionRequestServed(long timeTakenInMillis)indicates that a connection request is server in the timevoidconnectionsFreed(int count)indicates the number of connections freed to poolvoidconnectionTimedOut()indicates that a connection is timed-outvoidconnectionUsed(long resourceHandleId)indicates that a connection is being usedvoidconnectionValidationFailed(int count)indicates that a number of connections have failed validationvoiddecrementConnectionUsed(long resourceHandleId)indicates that connection count that is used has to be decremented.voiddecrementNumConnFree()indicates that free connections count in the pool has to be decremented.voidfoundPotentialConnectionLeak()indicates that a potential connection leak happenedvoidincrementNumConnFree(boolean beingDestroyed, int steadyPoolSize)indicates that a connection is freed and the count is to be incremented.voidregisterPoolLifeCycleListener(PoolLifeCycleListener listener)Add a listener to the list of pool life cycle listeners maintained by this registry.voidtoString(StringBuilder stackTrace)Print stack trace in server.logvoidunRegisterPoolLifeCycleListener(PoolInfo poolInfo)Clear the list of pool lifecycle listeners maintained by the registry.
-
-
-
Field Detail
-
poolListenersList
protected List<PoolLifeCycleListener> poolListenersList
-
-
Constructor Detail
-
PoolLifeCycleListenerRegistry
public PoolLifeCycleListenerRegistry(PoolInfo poolInfo)
-
-
Method Detail
-
registerPoolLifeCycleListener
public void registerPoolLifeCycleListener(PoolLifeCycleListener listener)
Add a listener to the list of pool life cycle listeners maintained by this registry.- Parameters:
listener-
-
unRegisterPoolLifeCycleListener
public void unRegisterPoolLifeCycleListener(PoolInfo poolInfo)
Clear the list of pool lifecycle listeners maintained by the registry. This happens when a pool is destroyed so the information about its listeners need not be stored.- Parameters:
poolName-
-
toString
public void toString(StringBuilder stackTrace)
Description copied from interface:PoolLifeCycleListenerPrint stack trace in server.log- Specified by:
toStringin interfacePoolLifeCycleListener
-
connectionAcquired
public void connectionAcquired(long resourceHandleId)
Description copied from interface:PoolLifeCycleListenerindicates that a connection is acquired by application- Specified by:
connectionAcquiredin interfacePoolLifeCycleListener
-
connectionRequestServed
public void connectionRequestServed(long timeTakenInMillis)
Description copied from interface:PoolLifeCycleListenerindicates that a connection request is server in the time- Specified by:
connectionRequestServedin interfacePoolLifeCycleListener- Parameters:
timeTakenInMillis- time taken to serve a connection
-
connectionTimedOut
public void connectionTimedOut()
Description copied from interface:PoolLifeCycleListenerindicates that a connection is timed-out- Specified by:
connectionTimedOutin interfacePoolLifeCycleListener
-
connectionNotMatched
public void connectionNotMatched()
Description copied from interface:PoolLifeCycleListenerindicates that a connection under test does not match the current request- Specified by:
connectionNotMatchedin interfacePoolLifeCycleListener
-
connectionMatched
public void connectionMatched()
Description copied from interface:PoolLifeCycleListenerindicates that a connection under test matches the current request- Specified by:
connectionMatchedin interfacePoolLifeCycleListener
-
connectionUsed
public void connectionUsed(long resourceHandleId)
Description copied from interface:PoolLifeCycleListenerindicates that a connection is being used- Specified by:
connectionUsedin interfacePoolLifeCycleListener
-
connectionDestroyed
public void connectionDestroyed(long resourceHandleId)
Description copied from interface:PoolLifeCycleListenerindicates that a connection is destroyed- Specified by:
connectionDestroyedin interfacePoolLifeCycleListener
-
connectionReleased
public void connectionReleased(long resourceHandleId)
Description copied from interface:PoolLifeCycleListenerindicates that a connection is released- Specified by:
connectionReleasedin interfacePoolLifeCycleListener
-
connectionCreated
public void connectionCreated()
Description copied from interface:PoolLifeCycleListenerindicates that a new connection is created- Specified by:
connectionCreatedin interfacePoolLifeCycleListener
-
foundPotentialConnectionLeak
public void foundPotentialConnectionLeak()
Description copied from interface:PoolLifeCycleListenerindicates that a potential connection leak happened- Specified by:
foundPotentialConnectionLeakin interfacePoolLifeCycleListener
-
connectionValidationFailed
public void connectionValidationFailed(int count)
Description copied from interface:PoolLifeCycleListenerindicates that a number of connections have failed validation- Specified by:
connectionValidationFailedin interfacePoolLifeCycleListener- Parameters:
count- number of connections
-
connectionsFreed
public void connectionsFreed(int count)
Description copied from interface:PoolLifeCycleListenerindicates the number of connections freed to pool- Specified by:
connectionsFreedin interfacePoolLifeCycleListener- Parameters:
count- number of connections
-
decrementConnectionUsed
public void decrementConnectionUsed(long resourceHandleId)
Description copied from interface:PoolLifeCycleListenerindicates that connection count that is used has to be decremented.- Specified by:
decrementConnectionUsedin interfacePoolLifeCycleListener
-
decrementNumConnFree
public void decrementNumConnFree()
Description copied from interface:PoolLifeCycleListenerindicates that free connections count in the pool has to be decremented.- Specified by:
decrementNumConnFreein interfacePoolLifeCycleListener
-
incrementNumConnFree
public void incrementNumConnFree(boolean beingDestroyed, int steadyPoolSize)Description copied from interface:PoolLifeCycleListenerindicates that a connection is freed and the count is to be incremented.- Specified by:
incrementNumConnFreein interfacePoolLifeCycleListener- Parameters:
beingDestroyed- in case of an error.
-
connectionRequestQueued
public void connectionRequestQueued()
Description copied from interface:PoolLifeCycleListenerindicates that the wait queue length has increased.- Specified by:
connectionRequestQueuedin interfacePoolLifeCycleListener
-
connectionRequestDequeued
public void connectionRequestDequeued()
Description copied from interface:PoolLifeCycleListenerindicates that the wait queue length has decreased.- Specified by:
connectionRequestDequeuedin interfacePoolLifeCycleListener
-
-