@SpiMeta(name="threadProtected") public class ThreadProtectedFilter extends Object implements InitializableFilter
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isProvider |
protected int |
maxThread |
protected int |
methodLimit |
protected ConcurrentHashMap<String,AtomicInteger> |
methodMap |
protected static ConcurrentHashMap<String,AtomicInteger> |
portTotalMap |
protected AtomicInteger |
totalCount |
protected int |
totalLimit |
| Constructor and Description |
|---|
ThreadProtectedFilter() |
| Modifier and Type | Method and Description |
|---|---|
Response |
filter(Caller<?> caller,
Request request) |
void |
init(Caller<?> caller)
默认策略当接口线程池占用达到3/4或者空闲小于150时,限制单个方法请求不能超过总线程数的1/2 需要自定义方法并发限制可以通过actives参数配置
|
protected static ConcurrentHashMap<String,AtomicInteger> portTotalMap
protected ConcurrentHashMap<String,AtomicInteger> methodMap
protected AtomicInteger totalCount
protected int maxThread
protected int totalLimit
protected int methodLimit
protected boolean isProvider
Copyright © 2019. All rights reserved.