Package org.apache.hc.core5.pool
Class PoolEntry<T,C extends ModalCloseable>
java.lang.Object
org.apache.hc.core5.pool.PoolEntry<T,C>
- Type Parameters:
T- the route type that represents the opposite endpoint of a pooled connection.C- the connection type.
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
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference<C> private longprivate final DisposalCallback<C> private Deadlineprivate final Tprivate Objectprivate final TimeValueprivate longprivate Deadline -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassignConnection(C conn) voiddiscardConnection(CloseMode closeMode) long(package private) longgetRoute()getState()longbooleantoString()voidupdateExpiry(TimeValue expiryTime) voidupdateState(Object state)
-
Field Details
-
route
-
timeToLive
-
connRef
-
disposalCallback
-
currentTimeSupplier
-
state
-
created
private volatile long created -
updated
private volatile long updated -
expiryDeadline
-
validityDeadline
-
-
Constructor Details
-
PoolEntry
-
PoolEntry
-
PoolEntry
Creates newPoolEntryinstance.- Parameters:
route- route to the opposite endpoint.timeToLive- maximum time to live. May be zero if the connection does not have an expiry deadline.disposalCallback- callback invoked before connection disposal.
-
PoolEntry
Creates newPoolEntryinstance.- Parameters:
route- route to the opposite endpoint.timeToLive- maximum time to live. May be zero if the connection does not have an expiry deadline.
-
PoolEntry
-
-
Method Details
-
getCurrentTime
long getCurrentTime() -
getRoute
-
getConnection
-
getValidityDeadline
- Since:
- 5.0
-
getState
-
getCreated
public long getCreated()- Since:
- 5.2
-
getUpdated
public long getUpdated() -
getExpiryDeadline
-
hasConnection
public boolean hasConnection()- Since:
- 5.0
-
assignConnection
- Since:
- 5.0
-
discardConnection
- Since:
- 5.0
-
updateExpiry
- Since:
- 5.0
-
updateState
- Since:
- 5.0
-
toString
-