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


Java Pool.create方法代码示例

本文整理汇总了Java中org.apache.tomcat.jni.Pool.create方法的典型用法代码示例。如果您正苦于以下问题:Java Pool.create方法的具体用法?Java Pool.create怎么用?Java Pool.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tomcat.jni.Pool的用法示例。


在下文中一共展示了Pool.create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.apache.tomcat.jni.Pool; //导入方法依赖的package包/类
/**
 * Create the sendfile poller. With some versions of APR, the maximum
 * poller size will be 62 (recompiling APR is necessary to remove this
 * limitation).
 */
protected void init() {
    pool = Pool.create(serverSockPool);
    int size = sendfileSize;
    if (size <= 0) {
        size = (OS.IS_WIN32 || OS.IS_WIN64) ? (1 * 1024) : (16 * 1024);
    }
    sendfilePollset = allocatePoller(size, pool, getSoTimeout());
    if (sendfilePollset == 0 && size > 1024) {
        size = 1024;
        sendfilePollset = allocatePoller(size, pool, getSoTimeout());
    }
    if (sendfilePollset == 0) {
        size = 62;
        sendfilePollset = allocatePoller(size, pool, getSoTimeout());
    }
    desc = new long[size * 2];
    sendfileData = new HashMap<Long, SendfileData>(size);
    addS = new ArrayList<SendfileData>();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:25,代码来源:AprEndpoint.java

示例2: init

import org.apache.tomcat.jni.Pool; //导入方法依赖的package包/类
/**
 * Create the sendfile poller. With some versions of APR, the maximum poller size will
 * be 62 (recompiling APR is necessary to remove this limitation).
 */
protected void init() {
    pool = Pool.create(serverSockPool);
    int size = sendfileSize;
    sendfilePollset = allocatePoller(size, pool, soTimeout);
    if (sendfilePollset == 0 && size > 1024) {
        size = 1024;
        sendfilePollset = allocatePoller(size, pool, soTimeout);
    }
    if (sendfilePollset == 0) {
        size = 62;
        sendfilePollset = allocatePoller(size, pool, soTimeout);
    }
    desc = new long[size * 2];
    sendfileData = new HashMap<Long, SendfileData>(size);
    addS = new ArrayList<SendfileData>();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:AprEndpoint.java

示例3: init

import org.apache.tomcat.jni.Pool; //导入方法依赖的package包/类
/**
 * Create the sendfile poller. With some versions of APR, the maximum
 * poller size will be 62 (recompiling APR is necessary to remove this
 * limitation).
 */
protected void init() {
	pool = Pool.create(serverSockPool);
	int size = sendfileSize;
	if (size <= 0) {
		size = (OS.IS_WIN32 || OS.IS_WIN64) ? (1 * 1024) : (16 * 1024);
	}
	sendfilePollset = allocatePoller(size, pool, getSoTimeout());
	if (sendfilePollset == 0 && size > 1024) {
		size = 1024;
		sendfilePollset = allocatePoller(size, pool, getSoTimeout());
	}
	if (sendfilePollset == 0) {
		size = 62;
		sendfilePollset = allocatePoller(size, pool, getSoTimeout());
	}
	desc = new long[size * 2];
	sendfileData = new HashMap<Long, SendfileData>(size);
	addS = new ArrayList<SendfileData>();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:25,代码来源:AprEndpoint.java

示例4: init

import org.apache.tomcat.jni.Pool; //导入方法依赖的package包/类
/**
 * Create the sendfile poller. With some versions of APR, the maximum poller size will
 * be 62 (recompiling APR is necessary to remove this limitation).
 */
protected void init() {
    pool = Pool.create(serverSockPool);
    int size = sendfileSize / sendfileThreadCount;
    sendfilePollset = allocatePoller(size, pool, socketProperties.getSoTimeout());
    if (sendfilePollset == 0 && size > 1024) {
        size = 1024;
        sendfilePollset = allocatePoller(size, pool, socketProperties.getSoTimeout());
    }
    if (sendfilePollset == 0) {
        size = 62;
        sendfilePollset = allocatePoller(size, pool, socketProperties.getSoTimeout());
    }
    desc = new long[size * 2];
    sendfileData = new HashMap<Long, SendfileData>(size);
    addS = new ArrayList<SendfileData>();
    addCount = 0;
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:22,代码来源:AprEndpoint.java

示例5: createAprPool

import org.apache.tomcat.jni.Pool; //导入方法依赖的package包/类
private long createAprPool() {

        // Create the pool for the server socket
        try {
            return Pool.create(0);
        } catch (UnsatisfiedLinkError e) {
            log.error("Could not create socket pool", e);
            return 0;
        }
    }
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:TestXxxEndpoint.java


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