Package org.attribyte.sql.pool
Class ConnectionPoolSegment
java.lang.Object
org.attribyte.sql.pool.ConnectionPoolSegment
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInitializes and creates a connection pool segment.classStatistics for this segment. -
Method Summary
Modifier and TypeMethodDescriptionCreates a segment initializer with default values.final intGets the number of active connections.final intGets the number of available connections.intGets the maximum number of connections.getStats()Gets statistics for the segment.Creates an empty initializer.
-
Method Details
-
defaultInitializer
Creates a segment initializer with default values.- Returns:
- The segment initializer with default values.
-
newInitializer
Creates an empty initializer.- Returns:
- The initializer.
-
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.
-