• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LimitLatch类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: 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:EdwardLee03,项目名称:tomcat-sr,代码行数:22,代码来源:AbstractEndpoint.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConnectFuture类代码示例发布时间:2022-05-23
下一篇:
Java BlockVine类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap