Interface DataSourcePool

All Superinterfaces:
CommonDataSource, DataSource, Wrapper

public interface DataSourcePool extends DataSource
DataSource pool API.
  • Method Details

    • name

      String name()
      Return the dataSource name.
    • getName

      @Deprecated default String getName()
      Deprecated.
      Deprecated migrate to name().
    • size

      int size()
      Return the current size of the pool. This includes both busy and idle connections.
    • isAutoCommit

      boolean isAutoCommit()
      Return true if the pool defaults to using autocommit.
    • isOnline

      boolean isOnline()
      Return true if the DataSource is online.

      Effectively the same as (synonym for) isDataSourceUp().

    • isDataSourceUp

      boolean isDataSourceUp()
      Returns false when the dataSource is down.

      Effectively the same as (synonym for) isOnline().

    • online

      void online() throws SQLException
      Bring the DataSource online ensuring min connections and start heart beat checking.
      Throws:
      SQLException
    • offline

      void offline()
      Take the DataSource offline closing all connections and stopping heart beat checking.
    • shutdown

      void shutdown()
      Shutdown the pool.

      This is functionally the same as offline() but generally we expect to only shut down the pool once whereas we can expect to make many calls to offline() and online().

    • status

      PoolStatus status(boolean reset)
      Return the current status of the connection pool.

      With reset true, the counters are reset.

    • getStatus

      @Deprecated default PoolStatus getStatus(boolean reset)
      Deprecated.
      Deprecated migrate to status().
    • dataSourceDownReason

      SQLException dataSourceDownReason()
      Returns the reason, why the dataSource is down.
    • getDataSourceDownReason

      @Deprecated default SQLException getDataSourceDownReason()
      Deprecated.
      Deprecated migrate to dataSourceDownReason().
    • setMaxSize

      void setMaxSize(int max)
      Set a new maximum size.

      The pool will apply the new maximum and not require a restart.

    • setWarningSize

      @Deprecated void setWarningSize(int warningSize)
      Deprecated.
      Deprecated - looking to remove.

      Set a new maximum size. The pool should respect this new warning level immediately and not require a restart. We may want to increase the maxConnections if the pool gets large and hits the warning levels.

    • getWarningSize

      @Deprecated int getWarningSize()
      Deprecated.
      Deprecated - looking to remove.

      Return the warning size. When the pool hits this size it can send a warning message to an administrator.