org.apache.http.pool
Class AbstractConnPool<T,C,E extends PoolEntry<T,C>>
java.lang.Object
org.apache.http.pool.AbstractConnPool<T,C,E>
- Type Parameters:
T
- routeC
- connection objectE
- pool entry
- All Implemented Interfaces:
- ConnPoolControl<T>
- Direct Known Subclasses:
- BasicConnPool
@ThreadSafe
public abstract class AbstractConnPool<T,C,E extends PoolEntry<T,C>>
- extends Object
- implements ConnPoolControl<T>
Abstract blocking connection pool.
- Since:
- 4.2
AbstractConnPool
public AbstractConnPool(int defaultMaxPerRoute,
int maxTotal)
createConnection
protected abstract C createConnection(T route)
throws IOException
- Throws:
IOException
createEntry
protected abstract E createEntry(T route,
C conn)
closeEntry
protected abstract void closeEntry(E entry)
isShutdown
public boolean isShutdown()
shutdown
public void shutdown(long waitMs)
throws IOException
- Throws:
IOException
lease
public Future<E> lease(T route,
Object state)
release
public void release(E entry,
boolean reusable)
setMaxTotal
public void setMaxTotal(int max)
- Specified by:
setMaxTotal
in interface ConnPoolControl<T>
setDefaultMaxPerRoute
public void setDefaultMaxPerRoute(int max)
- Specified by:
setDefaultMaxPerRoute
in interface ConnPoolControl<T>
setMaxPerRoute
public void setMaxPerRoute(T route,
int max)
- Specified by:
setMaxPerRoute
in interface ConnPoolControl<T>
getTotalStats
public PoolStats getTotalStats()
- Specified by:
getTotalStats
in interface ConnPoolControl<T>
getStats
public PoolStats getStats(T route)
- Specified by:
getStats
in interface ConnPoolControl<T>
closeIdle
public void closeIdle(long idletime,
TimeUnit tunit)
closeExpired
public void closeExpired()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.