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 void
connectionAcquired(long resourceHandleId)
indicates that a connection is acquired by applicationvoid
connectionCreated()
indicates that a new connection is createdvoid
connectionDestroyed(long resourceHandleId)
indicates that a connection is destroyedvoid
connectionMatched()
indicates that a connection under test matches the current requestvoid
connectionNotMatched()
indicates that a connection under test does not match the current requestvoid
connectionReleased(long resourceHandleId)
indicates that a connection is releasedvoid
connectionRequestDequeued()
indicates that the wait queue length has decreased.void
connectionRequestQueued()
indicates that the wait queue length has increased.void
connectionRequestServed(long timeTakenInMillis)
indicates that a connection request is server in the timevoid
connectionsFreed(int count)
indicates the number of connections freed to poolvoid
connectionTimedOut()
indicates that a connection is timed-outvoid
connectionUsed(long resourceHandleId)
indicates that a connection is being usedvoid
connectionValidationFailed(int count)
indicates that a number of connections have failed validationvoid
decrementConnectionUsed(long resourceHandleId)
indicates that connection count that is used has to be decremented.void
decrementNumConnFree()
indicates that free connections count in the pool has to be decremented.void
foundPotentialConnectionLeak()
indicates that a potential connection leak happenedvoid
incrementNumConnFree(boolean beingDestroyed, int steadyPoolSize)
indicates that a connection is freed and the count is to be incremented.void
registerPoolLifeCycleListener(PoolLifeCycleListener listener)
Add a listener to the list of pool life cycle listeners maintained by this registry.void
toString(StringBuilder stackTrace)
Print stack trace in server.logvoid
unRegisterPoolLifeCycleListener(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:PoolLifeCycleListener
Print stack trace in server.log- Specified by:
toString
in interfacePoolLifeCycleListener
-
connectionAcquired
public void connectionAcquired(long resourceHandleId)
Description copied from interface:PoolLifeCycleListener
indicates that a connection is acquired by application- Specified by:
connectionAcquired
in interfacePoolLifeCycleListener
-
connectionRequestServed
public void connectionRequestServed(long timeTakenInMillis)
Description copied from interface:PoolLifeCycleListener
indicates that a connection request is server in the time- Specified by:
connectionRequestServed
in interfacePoolLifeCycleListener
- Parameters:
timeTakenInMillis
- time taken to serve a connection
-
connectionTimedOut
public void connectionTimedOut()
Description copied from interface:PoolLifeCycleListener
indicates that a connection is timed-out- Specified by:
connectionTimedOut
in interfacePoolLifeCycleListener
-
connectionNotMatched
public void connectionNotMatched()
Description copied from interface:PoolLifeCycleListener
indicates that a connection under test does not match the current request- Specified by:
connectionNotMatched
in interfacePoolLifeCycleListener
-
connectionMatched
public void connectionMatched()
Description copied from interface:PoolLifeCycleListener
indicates that a connection under test matches the current request- Specified by:
connectionMatched
in interfacePoolLifeCycleListener
-
connectionUsed
public void connectionUsed(long resourceHandleId)
Description copied from interface:PoolLifeCycleListener
indicates that a connection is being used- Specified by:
connectionUsed
in interfacePoolLifeCycleListener
-
connectionDestroyed
public void connectionDestroyed(long resourceHandleId)
Description copied from interface:PoolLifeCycleListener
indicates that a connection is destroyed- Specified by:
connectionDestroyed
in interfacePoolLifeCycleListener
-
connectionReleased
public void connectionReleased(long resourceHandleId)
Description copied from interface:PoolLifeCycleListener
indicates that a connection is released- Specified by:
connectionReleased
in interfacePoolLifeCycleListener
-
connectionCreated
public void connectionCreated()
Description copied from interface:PoolLifeCycleListener
indicates that a new connection is created- Specified by:
connectionCreated
in interfacePoolLifeCycleListener
-
foundPotentialConnectionLeak
public void foundPotentialConnectionLeak()
Description copied from interface:PoolLifeCycleListener
indicates that a potential connection leak happened- Specified by:
foundPotentialConnectionLeak
in interfacePoolLifeCycleListener
-
connectionValidationFailed
public void connectionValidationFailed(int count)
Description copied from interface:PoolLifeCycleListener
indicates that a number of connections have failed validation- Specified by:
connectionValidationFailed
in interfacePoolLifeCycleListener
- Parameters:
count
- number of connections
-
connectionsFreed
public void connectionsFreed(int count)
Description copied from interface:PoolLifeCycleListener
indicates the number of connections freed to pool- Specified by:
connectionsFreed
in interfacePoolLifeCycleListener
- Parameters:
count
- number of connections
-
decrementConnectionUsed
public void decrementConnectionUsed(long resourceHandleId)
Description copied from interface:PoolLifeCycleListener
indicates that connection count that is used has to be decremented.- Specified by:
decrementConnectionUsed
in interfacePoolLifeCycleListener
-
decrementNumConnFree
public void decrementNumConnFree()
Description copied from interface:PoolLifeCycleListener
indicates that free connections count in the pool has to be decremented.- Specified by:
decrementNumConnFree
in interfacePoolLifeCycleListener
-
incrementNumConnFree
public void incrementNumConnFree(boolean beingDestroyed, int steadyPoolSize)
Description copied from interface:PoolLifeCycleListener
indicates that a connection is freed and the count is to be incremented.- Specified by:
incrementNumConnFree
in interfacePoolLifeCycleListener
- Parameters:
beingDestroyed
- in case of an error.
-
connectionRequestQueued
public void connectionRequestQueued()
Description copied from interface:PoolLifeCycleListener
indicates that the wait queue length has increased.- Specified by:
connectionRequestQueued
in interfacePoolLifeCycleListener
-
connectionRequestDequeued
public void connectionRequestDequeued()
Description copied from interface:PoolLifeCycleListener
indicates that the wait queue length has decreased.- Specified by:
connectionRequestDequeued
in interfacePoolLifeCycleListener
-
-