类 AbstractStateRouter
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.router.state.AbstractStateRouter
-
- 所有已实现的接口:
Comparable<StateRouter>,StateRouter
public abstract class AbstractStateRouter extends Object implements StateRouter
The abstract class of StateRoute.- 从以下版本开始:
- 3.0
-
-
字段概要
-
从接口继承的字段 org.apache.dubbo.rpc.cluster.router.state.StateRouter
DEFAULT_PRIORITY
-
-
构造器概要
构造器 构造器 说明 AbstractStateRouter(org.apache.dubbo.common.URL url, RouterChain chain)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intgetPriority()org.apache.dubbo.common.URLgetUrl()Get the router url.booleanisForce()booleanisRuntime()To decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.<T> voidnotify(List<Invoker<T>> invokers)voidpool()<T> BitList<Invoker<T>>route(BitList<Invoker<T>> invokers, RouterCache<T> cache, org.apache.dubbo.common.URL url, Invocation invocation)Filter invokers with current routing rule and only return the invokers that comply with the rule.voidsetForce(boolean force)voidsetPriority(int priority)voidsetUrl(org.apache.dubbo.common.URL url)<T> BooleantagMatchFail(BitList<Invoker<T>> invokers)-
从接口继承的方法 org.apache.dubbo.rpc.cluster.router.state.StateRouter
compareTo, getName, isEnable, pool, shouldRePool, stop
-
-
-
-
构造器详细资料
-
AbstractStateRouter
public AbstractStateRouter(org.apache.dubbo.common.URL url, RouterChain chain)
-
-
方法详细资料
-
notify
public <T> void notify(List<Invoker<T>> invokers)
- 指定者:
notify在接口中StateRouter
-
getUrl
public org.apache.dubbo.common.URL getUrl()
从接口复制的说明:StateRouterGet the router url.- 指定者:
getUrl在接口中StateRouter- 返回:
- url
-
setUrl
public void setUrl(org.apache.dubbo.common.URL url)
-
isRuntime
public boolean isRuntime()
从接口复制的说明:StateRouterTo decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.- 指定者:
isRuntime在接口中StateRouter- 返回:
- true if the router need to execute every time.
-
isForce
public boolean isForce()
- 指定者:
isForce在接口中StateRouter
-
setForce
public void setForce(boolean force)
-
getPriority
public int getPriority()
- 指定者:
getPriority在接口中StateRouter
-
setPriority
public void setPriority(int priority)
-
route
public <T> BitList<Invoker<T>> route(BitList<Invoker<T>> invokers, RouterCache<T> cache, org.apache.dubbo.common.URL url, Invocation invocation) throws RpcException
从接口复制的说明:StateRouterFilter invokers with current routing rule and only return the invokers that comply with the rule. Caching address lists in BitMap mode improves routing performance.- 指定者:
route在接口中StateRouter- 参数:
invokers- invoker bit listcache- router address cacheurl- refer urlinvocation- invocation- 返回:
- routed invokers
- 抛出:
RpcException
-
pool
public void pool()
- 指定者:
pool在接口中StateRouter
-
-