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

public abstract class AbstractConnectionPool<C> extends Object implements AutoCloseable
A pool for connections to be created and destroyed.
  • Constructor Details

  • Method Details

    • createConnection

      protected abstract C createConnection()
    • disposeConnection

      protected abstract void disposeConnection(C connection)
    • getConnections

      protected abstract Iterable<C> getConnections()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • numConnections

      public int numConnections()
      Returns:
      the number of open connections held by this pool.