Interface ConnectionPoolMBean

All Superinterfaces:
PoolConfiguration
All Known Implementing Classes:
ConnectionPool, DataSource, XADataSource

public interface ConnectionPoolMBean extends PoolConfiguration
JMX MBean interface for monitoring and managing a JDBC connection pool.
  • Field Details

    • NOTIFY_INIT

      static final String NOTIFY_INIT
      Notification type sent when the initialization of the pool fails, because an interceptor could not be started or because an initial connection of the pool could not be created and the failure is not ignored through ignoreExceptionOnPreLoad. The notification message carries the stack trace of the failure.
      See Also:
    • NOTIFY_CONNECT

      static final String NOTIFY_CONNECT
      Notification type sent when the pool cannot establish a physical connection to the database. The notification message carries the stack trace of the connection failure.
      See Also:
    • NOTIFY_ABANDON

      static final String NOTIFY_ABANDON
      Notification type sent when a connection that has been checked out longer than the remove-abandoned timeout is abandoned and removed from the pool. The notification message carries the stack trace of where the connection was borrowed, when the pool records those with logAbandoned.
      See Also:
    • SLOW_QUERY_NOTIFICATION

      static final String SLOW_QUERY_NOTIFICATION
      Notification type sent when the SlowQueryReportJmx interceptor reports a query that took longer than its configured threshold. This pool MBean sends it only when the interceptor is configured with notifyPool=true; otherwise the interceptor's own MBean sends the notification.
      See Also:
    • FAILED_QUERY_NOTIFICATION

      static final String FAILED_QUERY_NOTIFICATION
      Notification type sent when the SlowQueryReportJmx interceptor reports a query that failed. This pool MBean sends it only when the interceptor is configured with notifyPool=true; otherwise the interceptor's own MBean sends the notification.
      See Also:
    • SUSPECT_ABANDONED_NOTIFICATION

      static final String SUSPECT_ABANDONED_NOTIFICATION
      Notification type sent when the pool marks a connection as suspect because it has been checked out longer than the suspect timeout and is therefore suspected of having been abandoned. Unlike NOTIFY_ABANDON the connection is not removed from the pool. The notification message carries the stack trace of where the connection was borrowed, when the pool records those with logAbandoned.
      See Also:
    • POOL_EMPTY

      static final String POOL_EMPTY
      Notification type sent when a borrow from the pool fails because the pool is empty: the borrower was not willing to wait for a connection or its wait timed out. It is sent once per failed borrow, so a pool that stays exhausted sends one per failed borrow attempt.
      See Also:
    • SUSPECT_RETURNED_NOTIFICATION

      static final String SUSPECT_RETURNED_NOTIFICATION
      Notification type sent when a connection that the pool had marked as suspect is returned to the pool.
      See Also:
  • Method Details

    • getSize

      int getSize()
      Returns the total number of connections in the pool.
      Returns:
      total connection count
    • getIdle

      int getIdle()
      Returns the number of idle connections in the pool.
      Returns:
      idle connection count
    • getActive

      int getActive()
      Returns the number of active (in-use) connections.
      Returns:
      active connection count
    • getNumIdle

      int getNumIdle()
      Returns the number of idle connections in the pool.
      Returns:
      idle connection count
    • getNumActive

      int getNumActive()
      Returns the number of active (in-use) connections.
      Returns:
      active connection count
    • getWaitCount

      int getWaitCount()
      Returns the number of threads waiting for a connection.
      Returns:
      wait count
    • getBorrowedCount

      long getBorrowedCount()
      Returns the total number of connections borrowed since pool creation.
      Returns:
      borrowed count
    • getReturnedCount

      long getReturnedCount()
      Returns the total number of connections returned since pool creation.
      Returns:
      returned count
    • getCreatedCount

      long getCreatedCount()
      Returns the total number of connections created since pool creation.
      Returns:
      created count
    • getReleasedCount

      long getReleasedCount()
      Returns the total number of connections released since pool creation.
      Returns:
      released count
    • getReconnectedCount

      long getReconnectedCount()
      Returns the total number of reconnections since pool creation.
      Returns:
      reconnected count
    • getRemoveAbandonedCount

      long getRemoveAbandonedCount()
      Returns the total number of connections removed due to abandonment.
      Returns:
      abandoned count
    • getReleasedIdleCount

      long getReleasedIdleCount()
      Returns the total number of idle connections released by the pool cleaner.
      Returns:
      released idle count
    • checkIdle

      void checkIdle()
      Checks and cleans up idle connections in the pool.
    • checkAbandoned

      void checkAbandoned()
      Checks for and removes abandoned connections from the pool.
    • testIdle

      void testIdle()
      Validates all idle connections in the pool.
    • purge

      void purge()
      Purges all connections in the pool. For connections currently in use, these connections will be purged when returned on the pool. This call also purges connections that are idle and in the pool To only purge used/active connections see purgeOnReturn()
    • purgeOnReturn

      void purgeOnReturn()
      Purges connections when they are returned from the pool. This call does not purge idle connections until they are used. To purge idle connections see purge()
    • resetStats

      void resetStats()
      reset the statistics of this pool.