Class InternalConnectionPool

java.lang.Object
ru.curs.celesta.InternalConnectionPool
All Implemented Interfaces:
AutoCloseable, ConnectionPool

public final class InternalConnectionPool extends Object implements ConnectionPool
Database connection pool.
  • Method Details

    • create

      public static InternalConnectionPool create(ConnectionPoolConfiguration configuration)
      Factory method for connection pool creation.
      Parameters:
      configuration - connection pool configuration.
      Returns:
    • setDbAdaptor

      public void setDbAdaptor(DBAdaptor dbAdaptor)
      Sets DB adaptor.
      Specified by:
      setDbAdaptor in interface ConnectionPool
      Parameters:
      dbAdaptor - DB adaptor.
    • get

      public Connection get()
      Returns a connection from pool.
      Specified by:
      get in interface ConnectionPool
      Returns:
      connection from pool
    • close

      public void close()
      Closes up connection pool and all its connections, and makes it inaccessible.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ConnectionPool
    • poolSize

      public Object poolSize()
      Returns the number of connections available in the pool.
      Returns:
      count of available connections
    • isClosed

      public boolean isClosed()
      If the poll is closed then this method will return true.
      Specified by:
      isClosed in interface ConnectionPool
      Returns:
      true if the pool is closed; false otherwise.