Top Inners Fields Constructors Methods
org.apache.hc.core5.reactor

public abstract Class AbstractIOSessionPool<T>

extends Object
implements ModalCloseable
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.io.ModalCloseable, java.io.Closeable, java.lang.AutoCloseable
Annotations
@Contract
threading:SAFE
Imports
java.util.ArrayDeque, .HashSet, .Queue, .Set, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, .Future, java.util.concurrent.atomic.AtomicBoolean, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.concurrent.ComplexFuture, .FutureCallback, .FutureContribution, org.apache.hc.core5.function.Callback, org.apache.hc.core5.http.ConnectionClosedException, org.apache.hc.core5.io.CloseMode, .ModalCloseable, org.apache.hc.core5.util.Args, .Asserts, .TimeValue, .Timeout

Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private final ConcurrentMap<T, AbstractIOSessionPool.PoolEntry>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final void
close(final CloseMode
How to close the receiver.
closeMode
)

Implements org.apache.hc.core5.io.ModalCloseable.close.

Closes this process or endpoint and releases any system resources associated with it.
public final void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public final void
closeIdle(final TimeValue idleTime)

protected abstract void
closeSession(IOSession ioSession, CloseMode closeMode)

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

public final void
enumAvailable(final Callback<IOSession> callback)

pack-priv AbstractIOSessionPool.PoolEntry
getPoolEntry(final T endpoint)

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

private void
getSessionInternal(final AbstractIOSessionPool.PoolEntry poolEntry, final boolean requestNew, final T namedEndpoint, final Timeout connectTimeout, final FutureCallback<IOSession> callback)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
protected abstract void
validateSession(IOSession ioSession, Callback<Boolean> callback)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

closedback to summary
private final AtomicBoolean closed
sessionPoolback to summary
private final ConcurrentMap<T, AbstractIOSessionPool.PoolEntry> sessionPool

Constructor Detail

AbstractIOSessionPoolback to summary
public AbstractIOSessionPool()

Method Detail

closeback to summary
public final void close(final CloseMode closeMode)

Implements org.apache.hc.core5.io.ModalCloseable.close.

Doc from org.apache.hc.core5.io.ModalCloseable.close.

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.

Parameters
closeMode:CloseMode

How to close the receiver.

Annotations
@Override
closeback to summary
public final void close()

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
closeIdleback to summary
public final void closeIdle(final TimeValue idleTime)
closeSessionback to summary
protected abstract void closeSession(IOSession ioSession, CloseMode closeMode)
connectSessionback to summary
protected abstract Future<IOSession> connectSession(T namedEndpoint, Timeout connectTimeout, FutureCallback<IOSession> callback)
enumAvailableback to summary
public final void enumAvailable(final Callback<IOSession> callback)
getPoolEntryback to summary
pack-priv AbstractIOSessionPool.PoolEntry getPoolEntry(final T endpoint)
getRoutesback to summary
public final Set<T> getRoutes()
getSessionback to summary
public final Future<IOSession> getSession(final T endpoint, final Timeout connectTimeout, final FutureCallback<IOSession> callback)
getSessionInternalback to summary
private void getSessionInternal(final AbstractIOSessionPool.PoolEntry poolEntry, final boolean requestNew, final T namedEndpoint, final Timeout connectTimeout, final FutureCallback<IOSession> callback)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
validateSessionback to summary
protected abstract void validateSession(IOSession ioSession, Callback<Boolean> callback)
org.apache.hc.core5.reactor back to summary

pack-priv Class AbstractIOSessionPool.PoolEntry

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv volatile boolean
pack-priv final Queue<FutureCallback<IOSession>>
pack-priv volatile IOSession
pack-priv volatile Future<IOSession>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

completedback to summary
pack-priv volatile boolean completed
requestQueueback to summary
pack-priv final Queue<FutureCallback<IOSession>> requestQueue
sessionback to summary
pack-priv volatile IOSession session
sessionFutureback to summary
pack-priv volatile Future<IOSession> sessionFuture

Constructor Detail

PoolEntryback to summary
pack-priv PoolEntry()