Package com.github.twitch4j.common.pool
Class AbstractConnectionPool<C>
java.lang.Object
com.github.twitch4j.common.pool.AbstractConnectionPool<C>
- Type Parameters:
C
- the connection type
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
SubscriptionConnectionPool
A pool for connections to be created and destroyed.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
AbstractConnectionPool.AbstractConnectionPoolBuilder<C,
C2 extends AbstractConnectionPool<C>, B extends AbstractConnectionPool.AbstractConnectionPoolBuilder<C, C2, B>> -
Constructor Summary
ModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected abstract C
protected abstract void
disposeConnection
(C connection) int
-
Constructor Details
-
AbstractConnectionPool
-
-
Method Details
-
createConnection
-
disposeConnection
-
getConnections
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
numConnections
public int numConnections()- Returns:
- the number of open connections held by this pool.
-