接口 StateRouter
-
- 所有超级接口:
Comparable<StateRouter>
public interface StateRouter extends Comparable<StateRouter>
State Router. (SPI, Prototype, ThreadSafe)- 从以下版本开始:
- 3.0
- 另请参阅:
Cluster.join(Directory),Directory.list(Invocation)
-
-
字段概要
字段 修饰符和类型 字段 说明 static intDEFAULT_PRIORITY
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default intcompareTo(StateRouter o)StringgetName()intgetPriority()org.apache.dubbo.common.URLgetUrl()Get the router url.booleanisEnable()booleanisForce()booleanisRuntime()To decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.default <T> voidnotify(List<Invoker<T>> invokers)voidpool()<T> RouterCache<T>pool(List<Invoker<T>> invokers)<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.booleanshouldRePool()default voidstop()
-
-
-
字段详细资料
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
getUrl
org.apache.dubbo.common.URL getUrl()
Get the router url.- 返回:
- url
-
route
<T> BitList<Invoker<T>> route(BitList<Invoker<T>> invokers, RouterCache<T> cache, org.apache.dubbo.common.URL url, Invocation invocation) throws RpcException
Filter invokers with current routing rule and only return the invokers that comply with the rule. Caching address lists in BitMap mode improves routing performance.- 类型参数:
T-- 参数:
invokers- invoker bit listcache- router address cacheurl- refer urlinvocation- invocation- 返回:
- routed invokers
- 抛出:
RpcException
-
isRuntime
boolean isRuntime()
To decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.- 返回:
- true if the router need to execute every time.
-
isEnable
boolean isEnable()
-
isForce
boolean isForce()
-
getPriority
int getPriority()
-
compareTo
default int compareTo(StateRouter o)
- 指定者:
compareTo在接口中Comparable<StateRouter>
-
getName
String getName()
-
shouldRePool
boolean shouldRePool()
-
pool
<T> RouterCache<T> pool(List<Invoker<T>> invokers)
-
pool
void pool()
-
stop
default void stop()
-
-