本文整理汇总了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>();
}
示例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>();
}
示例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>();
}
示例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;
}
示例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;
}
}