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


Java LimitLatch类代码示例

本文整理汇总了Java中org.apache.tomcat.util.threads.LimitLatch的典型用法代码示例。如果您正苦于以下问题:Java LimitLatch类的具体用法?Java LimitLatch怎么用?Java LimitLatch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LimitLatch类属于org.apache.tomcat.util.threads包,在下文中一共展示了LimitLatch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setMaxConnections

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
public void setMaxConnections(int maxCon) {
    this.maxConnections = maxCon;
    LimitLatch latch = this.connectionLimitLatch;
    if (latch != null) {
        // Update the latch that enforces this
        if (maxCon == -1) {
            releaseConnectionLatch();
        } else {
            latch.setLimit(maxCon);
        }
    } else if (maxCon > 0) {
        initializeConnectionLatch();
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:15,代码来源:AbstractEndpoint.java

示例2: countDownConnection

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected long countDownConnection() {
    if (maxConnections==-1) return -1;
    LimitLatch latch = connectionLimitLatch;
    if (latch!=null) {
        long result = latch.countDown();
        if (result<0) {
            getLog().warn("Incorrect connection count, multiple socket.close called on the same socket." );
        }
        return result;
    } else return -1;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:12,代码来源:AbstractEndpoint.java

示例3: setMaxConnections

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
public void setMaxConnections(int maxCon) {
	this.maxConnections = maxCon;
	LimitLatch latch = this.connectionLimitLatch;
	if (latch != null) {
		// Update the latch that enforces this
		if (maxCon == -1) {
			releaseConnectionLatch();
		} else {
			latch.setLimit(maxCon);
		}
	} else if (maxCon > 0) {
		initializeConnectionLatch();
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:15,代码来源:AbstractEndpoint.java

示例4: countUpOrAwaitConnection

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected void countUpOrAwaitConnection() throws InterruptedException {
	if (maxConnections == -1)
		return;
	LimitLatch latch = connectionLimitLatch;
	if (latch != null)
		latch.countUpOrAwait();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:AbstractEndpoint.java

示例5: countDownConnection

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected long countDownConnection() {
	if (maxConnections == -1)
		return -1;
	LimitLatch latch = connectionLimitLatch;
	if (latch != null) {
		long result = latch.countDown();
		if (result < 0) {
			getLog().warn("Incorrect connection count, multiple socket.close called on the same socket.");
		}
		return result;
	} else
		return -1;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:14,代码来源:AbstractEndpoint.java

示例6: countDownConnection

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected long countDownConnection() {
	if (maxConnections == -1)
		return -1;
	LimitLatch latch = connectionLimitLatch;
	if (latch != null) {
		long result = latch.countDown();
		if (result < 0) {
			getLog().warn(
					"Incorrect connection count, multiple socket.close called on the same socket.");
		}
		return result;
	} else
		return -1;
}
 
开发者ID:EdwardLee03,项目名称:tomcat-sr,代码行数:15,代码来源:AbstractEndpoint.java

示例7: setMaxConnections

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
public void setMaxConnections(int maxCon) {
    this.maxConnections = maxCon;
    LimitLatch latch = this.connectionLimitLatch;
    if (latch != null) {
        // Update the latch that enforces this
        latch.setLimit(maxCon);
    }
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:9,代码来源:AbstractEndpoint.java

示例8: countDownConnection

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected long countDownConnection() {
    LimitLatch latch = connectionLimitLatch;
    if (latch!=null) {
        long result = latch.countDown();
        if (result<0) {
            getLog().warn("Incorrect connection count, multiple socket.close called on the same socket." );
        }
        return result;
    } else return -1;
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:11,代码来源:AbstractEndpoint.java

示例9: releaseConnectionLatch

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected void releaseConnectionLatch() {
    LimitLatch latch = connectionLimitLatch;
    if (latch!=null) latch.releaseAll();
    connectionLimitLatch = null;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:6,代码来源:AbstractEndpoint.java

示例10: countUpOrAwaitConnection

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected void countUpOrAwaitConnection() throws InterruptedException {
    if (maxConnections==-1) return;
    LimitLatch latch = connectionLimitLatch;
    if (latch!=null) latch.countUpOrAwait();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:6,代码来源:AbstractEndpoint.java

示例11: countUpOrAwaitConnection

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected void countUpOrAwaitConnection() throws InterruptedException {
    // 无限连接
    if (maxConnections==-1) return;
    LimitLatch latch = connectionLimitLatch;
    if (latch!=null) latch.countUpOrAwait();
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:7,代码来源:AbstractEndpoint.java

示例12: releaseConnectionLatch

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected void releaseConnectionLatch() {
	LimitLatch latch = connectionLimitLatch;
	if (latch != null)
		latch.releaseAll();
	connectionLimitLatch = null;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:7,代码来源:AbstractEndpoint.java

示例13: countUpOrAwaitConnection

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
protected void countUpOrAwaitConnection() throws InterruptedException {
    LimitLatch latch = connectionLimitLatch;
    if (latch!=null) latch.countUpOrAwait();
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:5,代码来源:AbstractEndpoint.java

示例14: getConnectionCount

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
/**
 * Return the current count of connections handled by this endpoint, if the
 * connections are counted (which happens when the maximum count of
 * connections is limited), or <code>-1</code> if they are not. This
 * property is added here so that this value can be inspected through JMX.
 * It is visible on "ThreadPool" MBean.
 *
 * <p>The count is incremented by the Acceptor before it tries to accept a
 * new connection. Until the limit is reached and thus the count cannot be
 * incremented,  this value is more by 1 (the count of acceptors) than the
 * actual count of connections that are being served.
 *
 * @return The count
 */
public long getConnectionCount() {
    LimitLatch latch = connectionLimitLatch;
    if (latch != null) {
        return latch.getCount();
    }
    return -1;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:22,代码来源:AbstractEndpoint.java

示例15: getConnectionCount

import org.apache.tomcat.util.threads.LimitLatch; //导入依赖的package包/类
/**
 * Return the current count of connections handled by this endpoint, if the
 * connections are counted (which happens when the maximum count of
 * connections is limited), or <code>-1</code> if they are not. This
 * property is added here so that this value can be inspected through JMX.
 * It is visible on "ThreadPool" MBean.
 *
 * <p>
 * The count is incremented by the Acceptor before it tries to accept a new
 * connection. Until the limit is reached and thus the count cannot be
 * incremented, this value is more by 1 (the count of acceptors) than the
 * actual count of connections that are being served.
 *
 * @return The count
 */
public long getConnectionCount() {
	LimitLatch latch = connectionLimitLatch;
	if (latch != null) {
		return latch.getCount();
	}
	return -1;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:23,代码来源:AbstractEndpoint.java


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