Class 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
    • 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 incremented
      void connectionRequestServed​(long timeTakenInMillis)
      Fires probe event related to the fact that a connection request is served in the time timeTakenInMillis 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 events
        provider -
    • 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 interface PoolLifeCycleListener
        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 interface PoolLifeCycleListener
      • connectionRequestServed

        public void connectionRequestServed​(long timeTakenInMillis)
        Fires probe event related to the fact that a connection request is served in the time timeTakenInMillis for the given jdbc connection pool.
        Specified by:
        connectionRequestServed in interface PoolLifeCycleListener
        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 interface PoolLifeCycleListener
      • 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 interface PoolLifeCycleListener
      • 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 interface PoolLifeCycleListener
      • connectionDestroyed

        public void connectionDestroyed​(long resourceHandleId)
        Fires probe event that a connection is destroyed for the given jdbc connection pool.
        Specified by:
        connectionDestroyed in interface PoolLifeCycleListener
      • connectionReleased

        public void connectionReleased​(long resourceHandleId)
        Fires probe event that a connection is released for the given jdbc connection pool.
        Specified by:
        connectionReleased in interface PoolLifeCycleListener
      • connectionCreated

        public void connectionCreated()
        Fires probe event that a connection is created for the given jdbc connection pool.
        Specified by:
        connectionCreated in interface PoolLifeCycleListener
      • 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 interface PoolLifeCycleListener
      • 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 interface PoolLifeCycleListener
        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 interface PoolLifeCycleListener
      • 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 interface PoolLifeCycleListener
        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 interface PoolLifeCycleListener
      • 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 interface PoolLifeCycleListener
      • 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 interface PoolLifeCycleListener
        Parameters:
        beingDestroyed - if the connection is destroyed due to error
        steadyPoolSize -
      • 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 interface PoolLifeCycleListener
      • 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 interface PoolLifeCycleListener
      • unregisterAppStatsProviders

        public void unregisterAppStatsProviders()
        Unregister the AppStatsProviders registered for this connection pool.