Class ConnectionPoolEmitterImpl
- java.lang.Object
-
- com.sun.enterprise.resource.pool.monitor.ConnectionPoolEmitterImpl
-
- All Implemented Interfaces:
PoolLifeCycleListener
public class ConnectionPoolEmitterImpl extends Object implements PoolLifeCycleListener
Implementation of PoolLifeCycleListener interface to listen to events related to jdbc monitoring. The methods invoke the probe providers internally to provide the monitoring related information.- Author:
- Shalini M
-
-
Constructor Summary
Constructors Constructor Description ConnectionPoolEmitterImpl(PoolInfo poolInfo, ConnectionPoolProbeProvider provider)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connectionAcquired(long resourceHandleId)
Fires probe event that a connection has been acquired by the application for the given jdbc connection pool.void
connectionCreated()
Fires probe event that a connection is created for the given jdbc connection pool.void
connectionDestroyed(long resourceHandleId)
Fires probe event that a connection is destroyed for the given jdbc connection pool.void
connectionMatched()
Fires probe event that a connection under test matches the current request for the given jdbc connection pool.void
connectionNotMatched()
Fires probe event that a connection under test does not match the current request for the given jdbc connection pool.void
connectionReleased(long resourceHandleId)
Fires probe event that a connection is released for the given jdbc connection pool.void
connectionRequestDequeued()
Fires probe event related to the fact the given jdbc connection pool's wait queue length has been decremented.void
connectionRequestQueued()
Fires probe event related to the fact the given jdbc connection pool's wait queue length has been incrementedvoid
connectionRequestServed(long timeTakenInMillis)
Fires probe event related to the fact that a connection request is served in the timetimeTakenInMillis
for the given jdbc connection pool.void
connectionsFreed(int count)
Fires probe event related to the fact the given jdbc connection pool has got a connection freed event.void
connectionTimedOut()
Fires probe event related to the fact that the given jdbc connection pool has got a connection timed-out event.void
connectionUsed(long resourceHandleId)
Fires probe event related to the fact the given jdbc connection pool has got a connection used event.void
connectionValidationFailed(int count)
Fires probe event related to the fact the given jdbc connection pool has got a connection validation failed event.void
decrementConnectionUsed(long resourceHandleId)
Fires probe event related to the fact the given jdbc connection pool has got a decrement connection used event.void
decrementNumConnFree()
Fires probe event related to the fact the given jdbc connection pool has got a decrement free connections size event.void
foundPotentialConnectionLeak()
Fires probe event related to the fact that the given jdbc connection pool has got a connection leak event.void
incrementNumConnFree(boolean beingDestroyed, int steadyPoolSize)
Fires probe event related to the fact the given jdbc connection pool has got a decrement free connections size event.void
toString(StringBuilder stackTrace)
Fires probe event that a stack trace is to be printed on the server.log.void
unregisterAppStatsProviders()
Unregister the AppStatsProviders registered for this connection pool.
-
-
-
Constructor Detail
-
ConnectionPoolEmitterImpl
public ConnectionPoolEmitterImpl(PoolInfo poolInfo, ConnectionPoolProbeProvider provider)
Constructor- Parameters:
poolInfo
- connection pool on whose behalf this emitter emits pool related probe eventsprovider
-
-
-
Method Detail
-
toString
public void toString(StringBuilder stackTrace)
Fires probe event that a stack trace is to be printed on the server.log. The stack trace is mainly related to connection leak tracing for the given jdbc connection pool.- Specified by:
toString
in interfacePoolLifeCycleListener
- Parameters:
stackTrace
-
-
connectionAcquired
public void connectionAcquired(long resourceHandleId)
Fires probe event that a connection has been acquired by the application for the given jdbc connection pool.- Specified by:
connectionAcquired
in interfacePoolLifeCycleListener
-
connectionRequestServed
public void connectionRequestServed(long timeTakenInMillis)
Fires probe event related to the fact that a connection request is served in the timetimeTakenInMillis
for the given jdbc connection pool.- Specified by:
connectionRequestServed
in interfacePoolLifeCycleListener
- Parameters:
timeTakenInMillis
- time taken to serve a connection
-
connectionTimedOut
public void connectionTimedOut()
Fires probe event related to the fact that the given jdbc connection pool has got a connection timed-out event.- Specified by:
connectionTimedOut
in interfacePoolLifeCycleListener
-
connectionNotMatched
public void connectionNotMatched()
Fires probe event that a connection under test does not match the current request for the given jdbc connection pool.- Specified by:
connectionNotMatched
in interfacePoolLifeCycleListener
-
connectionMatched
public void connectionMatched()
Fires probe event that a connection under test matches the current request for the given jdbc connection pool.- Specified by:
connectionMatched
in interfacePoolLifeCycleListener
-
connectionDestroyed
public void connectionDestroyed(long resourceHandleId)
Fires probe event that a connection is destroyed for the given jdbc connection pool.- Specified by:
connectionDestroyed
in interfacePoolLifeCycleListener
-
connectionReleased
public void connectionReleased(long resourceHandleId)
Fires probe event that a connection is released for the given jdbc connection pool.- Specified by:
connectionReleased
in interfacePoolLifeCycleListener
-
connectionCreated
public void connectionCreated()
Fires probe event that a connection is created for the given jdbc connection pool.- Specified by:
connectionCreated
in interfacePoolLifeCycleListener
-
foundPotentialConnectionLeak
public void foundPotentialConnectionLeak()
Fires probe event related to the fact that the given jdbc connection pool has got a connection leak event.- Specified by:
foundPotentialConnectionLeak
in interfacePoolLifeCycleListener
-
connectionValidationFailed
public void connectionValidationFailed(int count)
Fires probe event related to the fact the given jdbc connection pool has got a connection validation failed event.- Specified by:
connectionValidationFailed
in interfacePoolLifeCycleListener
- Parameters:
count
- number of times the validation failed
-
connectionUsed
public void connectionUsed(long resourceHandleId)
Fires probe event related to the fact the given jdbc connection pool has got a connection used event.- Specified by:
connectionUsed
in interfacePoolLifeCycleListener
-
connectionsFreed
public void connectionsFreed(int count)
Fires probe event related to the fact the given jdbc connection pool has got a connection freed event.- Specified by:
connectionsFreed
in interfacePoolLifeCycleListener
- Parameters:
count
- number of connections freed to pool
-
decrementConnectionUsed
public void decrementConnectionUsed(long resourceHandleId)
Fires probe event related to the fact the given jdbc connection pool has got a decrement connection used event.- Specified by:
decrementConnectionUsed
in interfacePoolLifeCycleListener
-
decrementNumConnFree
public void decrementNumConnFree()
Fires probe event related to the fact the given jdbc connection pool has got a decrement free connections size event.- Specified by:
decrementNumConnFree
in interfacePoolLifeCycleListener
-
incrementNumConnFree
public void incrementNumConnFree(boolean beingDestroyed, int steadyPoolSize)
Fires probe event related to the fact the given jdbc connection pool has got a decrement free connections size event.- Specified by:
incrementNumConnFree
in interfacePoolLifeCycleListener
- Parameters:
beingDestroyed
- if the connection is destroyed due to errorsteadyPoolSize
-
-
connectionRequestQueued
public void connectionRequestQueued()
Fires probe event related to the fact the given jdbc connection pool's wait queue length has been incremented- Specified by:
connectionRequestQueued
in interfacePoolLifeCycleListener
-
connectionRequestDequeued
public void connectionRequestDequeued()
Fires probe event related to the fact the given jdbc connection pool's wait queue length has been decremented.- Specified by:
connectionRequestDequeued
in interfacePoolLifeCycleListener
-
unregisterAppStatsProviders
public void unregisterAppStatsProviders()
Unregister the AppStatsProviders registered for this connection pool.
-
-