Class AbstractConnectionPool<C>

java.lang.Object
com.github.twitch4j.common.pool.AbstractConnectionPool<C>
Type Parameters:
C - the connection type
All Implemented Interfaces:
java.lang.AutoCloseable
Direct Known Subclasses:
SubscriptionConnectionPool

public abstract class AbstractConnectionPool<C>
extends java.lang.Object
implements java.lang.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 java.lang.Iterable<C> getConnections()
    • close

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

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