Class ConnectionPoolSegment

java.lang.Object
org.attribyte.sql.pool.ConnectionPoolSegment

public class ConnectionPoolSegment extends Object
A collection of connections that are managed as a single unit as part of a pool.

A segment contains a fixed number of physical database connections in one of the following states: available, open, closing, reopening, or disconnected.

Author:
Matt Hamer - Attribyte Labs, LLC
  • Method Details

    • defaultInitializer

      public static ConnectionPoolSegment.Initializer defaultInitializer()
      Creates a segment initializer with default values.
      Returns:
      The segment initializer with default values.
    • newInitializer

      public static ConnectionPoolSegment.Initializer newInitializer()
      Creates an empty initializer.
      Returns:
      The initializer.
    • getStats

      public ConnectionPoolSegment.Stats getStats()
      Gets statistics for the segment.
      Returns:
      The segment statistics.
    • getActiveConnectionCount

      public final int getActiveConnectionCount()
      Gets the number of active connections.
      Returns:
      The number of active connections.
    • getAvailableConnectionCount

      public final int getAvailableConnectionCount()
      Gets the number of available connections.
      Returns:
      The number of available connections.
    • getMaxConnections

      public int getMaxConnections()
      Gets the maximum number of connections.
      Returns:
      The maximum number of connections.