Class AbstractIOSessionPool<T>

java.lang.Object
org.apache.hc.core5.reactor.AbstractIOSessionPool<T>
All Implemented Interfaces:
Closeable, AutoCloseable, ModalCloseable

@Contract(threading=SAFE) public abstract class AbstractIOSessionPool<T> extends Object implements ModalCloseable
Since:
5.0
  • Constructor Details

    • AbstractIOSessionPool

      public AbstractIOSessionPool()
    • AbstractIOSessionPool

      public AbstractIOSessionPool(Clock clock)
      Since:
      5.5
  • Method Details

    • connectSession

      protected abstract Future<IOSession> connectSession(T namedEndpoint, Timeout connectTimeout, FutureCallback<IOSession> callback)
    • validateSession

      @Deprecated protected void validateSession(IOSession ioSession, Callback<Boolean> callback)
    • validateSession

      protected void validateSession(T endpoint, IOSession ioSession, Callback<Boolean> callback)
      Since:
      5.5
    • closeSession

      protected abstract void closeSession(IOSession ioSession, CloseMode closeMode)
    • clockMillis

      protected long clockMillis()
      Since:
      5.5
    • isIdle

      protected boolean isIdle(IOSession session)
      Tests if the given session is idle. This method is expected to be communication protocol aware.
      Since:
      5.5
    • isExpired

      protected boolean isExpired(T endpoint, IOSession session)
      Tests if the given session has expired. This method is expected to be communication protocol aware.
      Since:
      5.5
    • close

      public final void close(CloseMode closeMode)
      Description copied from interface: ModalCloseable
      Closes this process or endpoint and releases any system resources associated with it. If the endpoint or the process is already closed then invoking this method has no effect.
      Specified by:
      close in interface ModalCloseable
      Parameters:
      closeMode - How to close the receiver.
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getSession

      public final Future<IOSession> getSession(T endpoint, Timeout connectTimeout, FutureCallback<IOSession> callback)
    • enumAvailable

      @Deprecated public final void enumAvailable(Callback<IOSession> callback)
      Deprecated.
    • enumAvailable

      public final void enumAvailable(BiConsumer<T, IOSession> consumer)
      Since:
      5.5
    • closeIdle

      public final void closeIdle(TimeValue inactivityTime)
      Close sessions idle longer than the given period of inactivity. This method will also Evict closed sessions.
    • evictExpired

      public final void evictExpired()
      Evict expired (closed) sessions.
      Since:
      5.5
    • getRoutes

      public final Set<T> getRoutes()
    • toString

      public String toString()
      Overrides:
      toString in class Object