本文整理汇总了Java中org.apache.http.conn.ClientConnectionOperator类的典型用法代码示例。如果您正苦于以下问题:Java ClientConnectionOperator类的具体用法?Java ClientConnectionOperator怎么用?Java ClientConnectionOperator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClientConnectionOperator类属于org.apache.http.conn包,在下文中一共展示了ClientConnectionOperator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ManagedClientConnectionImpl
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
ManagedClientConnectionImpl(
final ClientConnectionManager manager,
final ClientConnectionOperator operator,
final HttpPoolEntry entry) {
super();
if (manager == null) {
throw new IllegalArgumentException("Connection manager may not be null");
}
if (operator == null) {
throw new IllegalArgumentException("Connection operator may not be null");
}
if (entry == null) {
throw new IllegalArgumentException("HTTP pool entry may not be null");
}
this.manager = manager;
this.operator = operator;
this.poolEntry = entry;
this.reusable = false;
this.duration = Long.MAX_VALUE;
}
示例2: ConnPoolByRoute
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* @since 4.1
*/
public ConnPoolByRoute(
final ClientConnectionOperator operator,
final ConnPerRoute connPerRoute,
int maxTotalConnections,
long connTTL,
final TimeUnit connTTLTimeUnit) {
super();
if (operator == null) {
throw new IllegalArgumentException("Connection operator may not be null");
}
if (connPerRoute == null) {
throw new IllegalArgumentException("Connections per route may not be null");
}
this.poolLock = super.poolLock;
this.leasedConnections = super.leasedConnections;
this.operator = operator;
this.connPerRoute = connPerRoute;
this.maxTotalConnections = maxTotalConnections;
this.freeConnections = createFreeConnQueue();
this.waitingThreads = createWaitingThreadQueue();
this.routeToPool = createRouteToPoolMap();
this.connTTL = connTTL;
this.connTTLTimeUnit = connTTLTimeUnit;
}
示例3: createEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* Creates a new pool entry.
* This method assumes that the new connection will be handed
* out immediately.
*
* @param rospl the route-specific pool for which to create the entry
* @param op the operator for creating a connection
*
* @return the new pool entry for a new connection
*/
protected BasicPoolEntry createEntry(RouteSpecificPool rospl,
ClientConnectionOperator op) {
if (log.isDebugEnabled()) {
log.debug("Creating new connection [" + rospl.getRoute() + "]");
}
// the entry will create the connection when needed
BasicPoolEntry entry = new BasicPoolEntry(op, rospl.getRoute(), connTTL, connTTLTimeUnit);
poolLock.lock();
try {
rospl.createdEntry(entry);
numConnections++;
leasedConnections.add(entry);
} finally {
poolLock.unlock();
}
return entry;
}
示例4: ConnPoolByRoute
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* @since 4.1
*/
public ConnPoolByRoute(
final ClientConnectionOperator operator,
final ConnPerRoute connPerRoute,
final int maxTotalConnections,
final long connTTL,
final TimeUnit connTTLTimeUnit) {
super();
Args.notNull(operator, "Connection operator");
Args.notNull(connPerRoute, "Connections per route");
this.poolLock = super.poolLock;
this.leasedConnections = super.leasedConnections;
this.operator = operator;
this.connPerRoute = connPerRoute;
this.maxTotalConnections = maxTotalConnections;
this.freeConnections = createFreeConnQueue();
this.waitingThreads = createWaitingThreadQueue();
this.routeToPool = createRouteToPoolMap();
this.connTTL = connTTL;
this.connTTLTimeUnit = connTTLTimeUnit;
}
示例5: createEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* Creates a new pool entry.
* This method assumes that the new connection will be handed
* out immediately.
*
* @param rospl the route-specific pool for which to create the entry
* @param op the operator for creating a connection
*
* @return the new pool entry for a new connection
*/
protected BasicPoolEntry createEntry(final RouteSpecificPool rospl,
final ClientConnectionOperator op) {
if (log.isDebugEnabled()) {
log.debug("Creating new connection [" + rospl.getRoute() + "]");
}
// the entry will create the connection when needed
final BasicPoolEntry entry = new BasicPoolEntry(op, rospl.getRoute(), connTTL, connTTLTimeUnit);
poolLock.lock();
try {
rospl.createdEntry(entry);
numConnections++;
leasedConnections.add(entry);
} finally {
poolLock.unlock();
}
return entry;
}
示例6: createEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* Creates a new pool entry.
* This method assumes that the new connection will be handed
* out immediately.
*
* @param rospl the route-specific pool for which to create the entry
* @param op the operator for creating a connection
*
* @return the new pool entry for a new connection
*/
protected BasicPoolEntry createEntry(RouteSpecificPool rospl,
ClientConnectionOperator op) {
if (log.isDebugEnabled()) {
log.debug("Creating new connection [" + rospl.getRoute() + "]");
}
// the entry will create the connection when needed
BasicPoolEntry entry = new BasicPoolEntry(op, rospl.getRoute());
poolLock.lock();
try {
rospl.createdEntry(entry);
numConnections++;
leasedConnections.add(entry);
} finally {
poolLock.unlock();
}
return entry;
}
示例7: BasicPoolEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
public BasicPoolEntry(ClientConnectionOperator op,
HttpRoute route,
ReferenceQueue<Object> queue) {
super(op, route);
if (route == null) {
throw new IllegalArgumentException("HTTP route may not be null");
}
this.created = System.currentTimeMillis();
this.validUntil = Long.MAX_VALUE;
this.expiry = this.validUntil;
}
示例8: AbstractPoolEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* Creates a new pool entry.
*
* @param connOperator the Connection Operator for this entry
* @param route the planned route for the connection,
* or <code>null</code>
*/
protected AbstractPoolEntry(ClientConnectionOperator connOperator,
HttpRoute route) {
super();
if (connOperator == null) {
throw new IllegalArgumentException("Connection operator may not be null");
}
this.connOperator = connOperator;
this.connection = connOperator.createConnection();
this.route = route;
this.tracker = null;
}
示例9: HttpConnPool
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
public HttpConnPool(final Log log,
final ClientConnectionOperator connOperator,
final int defaultMaxPerRoute, final int maxTotal,
final long timeToLive, final TimeUnit tunit) {
super(new InternalConnFactory(connOperator), defaultMaxPerRoute, maxTotal);
this.log = log;
this.timeToLive = timeToLive;
this.tunit = tunit;
}
示例10: ManagedClientConnectionImpl
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
ManagedClientConnectionImpl(
final ClientConnectionManager manager,
final ClientConnectionOperator operator,
final HttpPoolEntry entry) {
super();
Args.notNull(manager, "Connection manager");
Args.notNull(operator, "Connection operator");
Args.notNull(entry, "HTTP pool entry");
this.manager = manager;
this.operator = operator;
this.poolEntry = entry;
this.reusable = false;
this.duration = Long.MAX_VALUE;
}
示例11: BasicPoolEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
public BasicPoolEntry(final ClientConnectionOperator op,
final HttpRoute route,
final ReferenceQueue<Object> queue) {
super(op, route);
Args.notNull(route, "HTTP route");
this.created = System.currentTimeMillis();
this.validUntil = Long.MAX_VALUE;
this.expiry = this.validUntil;
}
示例12: AbstractPoolEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* Creates a new pool entry.
*
* @param connOperator the Connection Operator for this entry
* @param route the planned route for the connection,
* or {@code null}
*/
protected AbstractPoolEntry(final ClientConnectionOperator connOperator,
final HttpRoute route) {
super();
Args.notNull(connOperator, "Connection operator");
this.connOperator = connOperator;
this.connection = connOperator.createConnection();
this.route = route;
this.tracker = null;
}
示例13: ConnPoolByRoute
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* Creates a new connection pool, managed by route.
*/
public ConnPoolByRoute(final ClientConnectionOperator operator, final HttpParams params) {
super();
if (operator == null) {
throw new IllegalArgumentException("Connection operator may not be null");
}
this.operator = operator;
this.params = params;
freeConnections = createFreeConnQueue();
waitingThreads = createWaitingThreadQueue();
routeToPool = createRouteToPoolMap();
}
示例14: BasicPoolEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
/**
* @deprecated do not use
*/
@Deprecated
public BasicPoolEntry(ClientConnectionOperator op,
HttpRoute route,
ReferenceQueue<Object> queue) {
super(op, route);
if (route == null) {
throw new IllegalArgumentException("HTTP route may not be null");
}
}
示例15: createEntry
import org.apache.http.conn.ClientConnectionOperator; //导入依赖的package包/类
@Override
protected BasicPoolEntry createEntry(RouteSpecificPool rospl,
ClientConnectionOperator op) {
createEntryCounter.increment();
Stopwatch stopWatch = creationTimer.start();
try {
return super.createEntry(rospl, op);
} finally {
stopWatch.stop();
}
}