T
- the route type that represents the opposite endpoint of a pooled
connection.C
- the connection type.public final class PoolEntry<T,C extends ModalCloseable> extends Object
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).
Constructor and Description |
---|
PoolEntry(T route) |
PoolEntry(T route,
TimeValue timeToLive)
Creates new
PoolEntry instance. |
PoolEntry(T route,
TimeValue timeToLive,
DisposalCallback<C> disposalCallback)
Creates new
PoolEntry instance. |
Modifier and Type | Method and Description |
---|---|
void |
assignConnection(C conn) |
void |
discardConnection(CloseMode closeMode) |
C |
getConnection() |
Deadline |
getExpiryDeadline() |
T |
getRoute() |
Object |
getState() |
long |
getUpdated() |
Deadline |
getValidityDeadline() |
boolean |
hasConnection() |
String |
toString() |
void |
updateExpiry(TimeValue expiryTime) |
void |
updateState(Object state) |
public PoolEntry(T route, TimeValue timeToLive, DisposalCallback<C> disposalCallback)
PoolEntry
instance.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.public PoolEntry(T route, TimeValue timeToLive)
PoolEntry
instance.route
- route to the opposite endpoint.timeToLive
- maximum time to live. May be zero if the connection
does not have an expiry deadline.public PoolEntry(T route)
public T getRoute()
public C getConnection()
public Deadline getValidityDeadline()
public Object getState()
public long getUpdated()
public Deadline getExpiryDeadline()
public boolean hasConnection()
public void assignConnection(C conn)
public void discardConnection(CloseMode closeMode)
public void updateExpiry(TimeValue expiryTime)
public void updateState(Object state)
Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.