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 long
private final DisposalCallback
<C> private Deadline
private final T
private Object
private final TimeValue
private long
private Deadline
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignConnection
(C conn) void
discardConnection
(CloseMode closeMode) long
(package private) long
getRoute()
getState()
long
boolean
toString()
void
updateExpiry
(TimeValue expiryTime) void
updateState
(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 newPoolEntry
instance.- 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 newPoolEntry
instance.- 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
-