public class MeshRuleRouter extends Object implements Router, VsDestinationGroupRuleListener
DEFAULT_PRIORITY| Constructor and Description |
|---|
MeshRuleRouter(org.apache.dubbo.common.URL url) |
| Modifier and Type | Method and Description |
|---|---|
List<Invoker<?>> |
getInvokerList() |
int |
getPriority()
Router's priority, used to sort routers.
|
Map<String,String> |
getSourcesLabels() |
Map<String,List<Invoker<?>>> |
getSubsetMap() |
org.apache.dubbo.common.URL |
getUrl()
Get the router url.
|
VsDestinationGroup |
getVsDestinationGroup() |
boolean |
isForce()
To decide whether this router should take effect when none of the invoker can match the router rule, which
means the
Router.route(List, URL, Invocation) would be empty. |
boolean |
isRuntime()
To decide whether this router need to execute every time an RPC comes or should only execute when addresses or
rule change.
|
<T> void |
notify(List<Invoker<T>> invokers)
Notify the router the invoker list.
|
void |
onRuleChange(VsDestinationGroup vsDestinationGroup) |
<T> RouterResult<Invoker<T>> |
route(List<Invoker<T>> invokers,
org.apache.dubbo.common.URL url,
Invocation invocation,
boolean needToPrintMessage)
** This method can return the state of whether routerChain needed to continue route.
|
void |
stop() |
public org.apache.dubbo.common.URL getUrl()
Routerpublic <T> RouterResult<Invoker<T>> route(List<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation, boolean needToPrintMessage) throws RpcException
Routerroute in interface Routerinvokers - invoker listurl - refer urlinvocation - invocationneedToPrintMessage - whether to print router state. Such as `use router branch a`.RpcExceptionpublic <T> void notify(List<Invoker<T>> invokers)
RouterRouter.route(List, URL, Invocation) gets called.public void onRuleChange(VsDestinationGroup vsDestinationGroup)
onRuleChange in interface VsDestinationGroupRuleListenerpublic boolean isRuntime()
Routerpublic boolean isForce()
RouterRouter.route(List, URL, Invocation) would be empty. Most of time, most router implementation would
default this value to false.public int getPriority()
RoutergetPriority in interface Routerpublic VsDestinationGroup getVsDestinationGroup()
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.