类 ListenableRouter
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.router.AbstractRouter
-
- org.apache.dubbo.rpc.cluster.router.condition.config.ListenableRouter
-
- 所有已实现的接口:
Comparable<Router>,EventListener,org.apache.dubbo.common.config.configcenter.ConfigurationListener,Router
- 直接已知子类:
AppRouter,ServiceRouter
public abstract class ListenableRouter extends AbstractRouter implements org.apache.dubbo.common.config.configcenter.ConfigurationListener
Abstract router which listens to dynamic configuration
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringNAME-
从接口继承的字段 org.apache.dubbo.rpc.cluster.Router
DEFAULT_PRIORITY
-
-
构造器概要
构造器 构造器 说明 ListenableRouter(org.apache.dubbo.common.URL url, String ruleKey)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intgetPriority()Router's priority, used to sort routers.booleanisForce()To decide whether this router should take effect when none of the invoker can match the router rule, which means theRouter.route(List, URL, Invocation)would be empty.voidprocess(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event)<T> List<Invoker<T>>route(List<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation)Filter invokers with current routing rule and only return the invokers that comply with the rule.-
从类继承的方法 org.apache.dubbo.rpc.cluster.router.AbstractRouter
getUrl, isRuntime, setForce, setPriority, setUrl
-
-
-
-
构造器详细资料
-
ListenableRouter
public ListenableRouter(org.apache.dubbo.common.URL url, String ruleKey)
-
-
方法详细资料
-
process
public void process(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event)
- 指定者:
process在接口中org.apache.dubbo.common.config.configcenter.ConfigurationListener
-
route
public <T> List<Invoker<T>> route(List<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation) throws RpcException
从接口复制的说明:RouterFilter invokers with current routing rule and only return the invokers that comply with the rule.- 指定者:
route在接口中Router- 参数:
invokers- invoker listurl- refer urlinvocation- invocation- 返回:
- routed invokers
- 抛出:
RpcException
-
getPriority
public int getPriority()
从接口复制的说明:RouterRouter's priority, used to sort routers.- 指定者:
getPriority在接口中Router- 覆盖:
getPriority在类中AbstractRouter- 返回:
- router's priority
-
isForce
public boolean isForce()
从接口复制的说明:RouterTo decide whether this router should take effect when none of the invoker can match the router rule, which means theRouter.route(List, URL, Invocation)would be empty. Most of time, most router implementation would default this value to false.- 指定者:
isForce在接口中Router- 覆盖:
isForce在类中AbstractRouter- 返回:
- true to execute if none of invokers matches the current router
-
-