Top Description Fields Constructors Methods
org.apache.hc.core5.pool

public final Class PoolEntry<T, C extends org.apache.hc.core5.io.ModalCloseable>

extends Object
Class Inheritance
Type Parameters
<T>
the route type that represents the opposite endpoint of a pooled connection.
<C>
the connection type.
Imports
java.util.concurrent.atomic.AtomicReference, org.apache.hc.core5.function.Supplier, org.apache.hc.core5.io.CloseMode, .ModalCloseable, org.apache.hc.core5.util.Args, .Deadline, .TimeValue

Pool entry containing a pool connection object along with its route.

The connection assigned to this pool entry may have an expiration time and also have an object representing a connection state (usually a security principal or a unique token identifying the user whose credentials have been used while establishing the connection).

Since
4.2

Field Summary

Modifier and TypeField and Description
private final AtomicReference<C>
private volatile long
private final Supplier<Long>
private final DisposalCallback<C>
private volatile Deadline
private final T
private volatile Object
private final TimeValue
private volatile long
private volatile Deadline

Constructor Summary

AccessConstructor and Description
pack-priv
PoolEntry(final T route, final TimeValue timeToLive, final DisposalCallback<C> disposalCallback, final Supplier<Long> currentTimeSupplier)

pack-priv
PoolEntry(final T route, final TimeValue timeToLive, final Supplier<Long> currentTimeSupplier)

public
PoolEntry(final T
route to the opposite endpoint.
route
,
final TimeValue
maximum time to live. May be zero if the connection does not have an expiry deadline.
timeToLive
,
final DisposalCallback<C>
callback invoked before connection disposal.
disposalCallback
)

Creates new PoolEntry instance.

public
PoolEntry(final T
route to the opposite endpoint.
route
,
final TimeValue
maximum time to live. May be zero if the connection does not have an expiry deadline.
timeToLive
)

Creates new PoolEntry instance.

public
PoolEntry(final T route)

Method Summary

Modifier and TypeMethod and Description
public void
assignConnection(final C conn)

public void
discardConnection(final CloseMode closeMode)

public C
public long
pack-priv long
public Deadline
public T
public Object
public long
public Deadline
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
updateExpiry(final TimeValue expiryTime)

public void
updateState(final Object state)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

connRefback to summary
private final AtomicReference<C> connRef
createdback to summary
private volatile long created
currentTimeSupplierback to summary
private final Supplier<Long> currentTimeSupplier
disposalCallbackback to summary
private final DisposalCallback<C> disposalCallback
expiryDeadlineback to summary
private volatile Deadline expiryDeadline
routeback to summary
private final T route
stateback to summary
private volatile Object state
timeToLiveback to summary
private final TimeValue timeToLive
updatedback to summary
private volatile long updated
validityDeadlineback to summary
private volatile Deadline validityDeadline

Constructor Detail

PoolEntryback to summary
pack-priv PoolEntry(final T route, final TimeValue timeToLive, final DisposalCallback<C> disposalCallback, final Supplier<Long> currentTimeSupplier)
PoolEntryback to summary
pack-priv PoolEntry(final T route, final TimeValue timeToLive, final Supplier<Long> currentTimeSupplier)
PoolEntryback to summary
public PoolEntry(final T route, final TimeValue timeToLive, final DisposalCallback<C> disposalCallback)

Creates new PoolEntry instance.

Parameters
route:T

route to the opposite endpoint.

timeToLive:TimeValue

maximum time to live. May be zero if the connection does not have an expiry deadline.

disposalCallback:DisposalCallback<C>

callback invoked before connection disposal.

PoolEntryback to summary
public PoolEntry(final T route, final TimeValue timeToLive)

Creates new PoolEntry instance.

Parameters
route:T

route to the opposite endpoint.

timeToLive:TimeValue

maximum time to live. May be zero if the connection does not have an expiry deadline.

PoolEntryback to summary
public PoolEntry(final T route)

Method Detail

assignConnectionback to summary
public void assignConnection(final C conn)
Since
5.0
discardConnectionback to summary
public void discardConnection(final CloseMode closeMode)
Since
5.0
getConnectionback to summary
public C getConnection()
getCreatedback to summary
public long getCreated()
Since
5.2
getCurrentTimeback to summary
pack-priv long getCurrentTime()
getExpiryDeadlineback to summary
public Deadline getExpiryDeadline()
getRouteback to summary
public T getRoute()
getStateback to summary
public Object getState()
getUpdatedback to summary
public long getUpdated()
getValidityDeadlineback to summary
public Deadline getValidityDeadline()
Since
5.0
hasConnectionback to summary
public boolean hasConnection()
Since
5.0
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
updateExpiryback to summary
public void updateExpiry(final TimeValue expiryTime)
Since
5.0
updateStateback to summary
public void updateState(final Object state)
Since
5.0