当前位置: 首页>>代码示例>>Java>>正文


Java ClientConnectionOperator类代码示例

本文整理汇总了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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:ManagedClientConnectionImpl.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:ConnPoolByRoute.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:32,代码来源:ConnPoolByRoute.java

示例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;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:24,代码来源:ConnPoolByRoute.java

示例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;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:32,代码来源:ConnPoolByRoute.java

示例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;
}
 
开发者ID:tdopires,项目名称:cJUnit-mc626,代码行数:32,代码来源:ConnPoolByRoute.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:BasicPoolEntry.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AbstractPoolEntry.java

示例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;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:10,代码来源:HttpConnPool.java

示例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;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:15,代码来源:ManagedClientConnectionImpl.java

示例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;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:10,代码来源:BasicPoolEntry.java

示例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;
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:17,代码来源:AbstractPoolEntry.java

示例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();
}
 
开发者ID:tdopires,项目名称:cJUnit-mc626,代码行数:16,代码来源:ConnPoolByRoute.java

示例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");
    }
}
 
开发者ID:tdopires,项目名称:cJUnit-mc626,代码行数:13,代码来源:BasicPoolEntry.java

示例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();
    }
}
 
开发者ID:Netflix,项目名称:ribbon,代码行数:12,代码来源:NamedConnectionPool.java


注:本文中的org.apache.http.conn.ClientConnectionOperator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。