类 MeshRuleRouter
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.router.mesh.route.MeshRuleRouter
-
- 所有已实现的接口:
Comparable<Router>,Router,VsDestinationGroupRuleListener
public class MeshRuleRouter extends Object implements Router, VsDestinationGroupRuleListener
-
-
字段概要
-
从接口继承的字段 org.apache.dubbo.rpc.cluster.Router
DEFAULT_PRIORITY
-
-
构造器概要
构造器 构造器 说明 MeshRuleRouter(org.apache.dubbo.common.URL url)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<Invoker<?>>getInvokerList()intgetPriority()Router's priority, used to sort routers.Map<String,String>getSourcesLabels()Map<String,List<Invoker<?>>>getSubsetMap()org.apache.dubbo.common.URLgetUrl()Get the router url.VsDestinationGroupgetVsDestinationGroup()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.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)Notify the router the invoker list.voidonRuleChange(VsDestinationGroup vsDestinationGroup)<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.
-
-
-
方法详细资料
-
getUrl
public org.apache.dubbo.common.URL getUrl()
从接口复制的说明:RouterGet the router url.
-
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
-
notify
public <T> void notify(List<Invoker<T>> invokers)
从接口复制的说明:RouterNotify the router the invoker list. Invoker list may change from time to time. This method gives the router a chance to prepare beforeRouter.route(List, URL, Invocation)gets called.
-
onRuleChange
public void onRuleChange(VsDestinationGroup vsDestinationGroup)
- 指定者:
onRuleChange在接口中VsDestinationGroupRuleListener
-
isRuntime
public boolean isRuntime()
从接口复制的说明:RouterTo decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.
-
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.
-
getPriority
public int getPriority()
从接口复制的说明:RouterRouter's priority, used to sort routers.- 指定者:
getPriority在接口中Router- 返回:
- router's priority
-
getVsDestinationGroup
public VsDestinationGroup getVsDestinationGroup()
-
-