Package org.apache.http.pool
Class PoolEntry<T,C>
- java.lang.Object
 - 
- org.apache.http.pool.PoolEntry<T,C>
 
 
- 
- Type Parameters:
 T- the route type that represents the opposite endpoint of a pooled connection.C- the connection type.
- Direct Known Subclasses:
 BasicNIOPoolEntry,BasicPoolEntry
@Contract(threading=SAFE_CONDITIONAL) public abstract class PoolEntry<T,C> extends java.lang.Object
Pool entry containing a pool connection object along with its route.The connection contained by the pool entry may have an expiration time which can be either set upon construction time or updated with the
updateExpiry(long, TimeUnit).Pool entry may also have an object associated with it that represents 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
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract voidclose()Invalidates the pool entry and closes the pooled connection associated with it.CgetConnection()longgetCreated()longgetExpiry()java.lang.StringgetId()TgetRoute()java.lang.ObjectgetState()longgetUpdated()longgetValidityDeadline()longgetValidUnit()Deprecated.abstract booleanisClosed()Returnstrueif the pool entry has been invalidated.booleanisExpired(long now)voidsetState(java.lang.Object state)java.lang.StringtoString()voidupdateExpiry(long time, java.util.concurrent.TimeUnit tunit) 
 - 
 
- 
- 
Constructor Detail
- 
PoolEntry
public PoolEntry(java.lang.String id, T route, C conn, long timeToLive, java.util.concurrent.TimeUnit tunit)Creates newPoolEntryinstance.- Parameters:
 id- unique identifier of the pool entry. May benull.route- route to the opposite endpoint.conn- the connection.timeToLive- maximum time to live. May be zero if the connection does not have an expiry deadline.tunit- time unit.
 
 - 
 
- 
Method Detail
- 
getId
public java.lang.String getId()
 
- 
getRoute
public T getRoute()
 
- 
getConnection
public C getConnection()
 
- 
getCreated
public long getCreated()
 
- 
getValidityDeadline
public long getValidityDeadline()
- Since:
 - 4.4
 
 
- 
getValidUnit
@Deprecated public long getValidUnit()
Deprecated. 
- 
getState
public java.lang.Object getState()
 
- 
setState
public void setState(java.lang.Object state)
 
- 
getUpdated
public long getUpdated()
 
- 
getExpiry
public long getExpiry()
 
- 
updateExpiry
public void updateExpiry(long time, java.util.concurrent.TimeUnit tunit) 
- 
isExpired
public boolean isExpired(long now)
 
- 
close
public abstract void close()
Invalidates the pool entry and closes the pooled connection associated with it. 
- 
isClosed
public abstract boolean isClosed()
Returnstrueif the pool entry has been invalidated. 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -