public abstract class ListenableRouter extends AbstractRouter implements org.apache.dubbo.common.config.configcenter.ConfigurationListener
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME |
DEFAULT_PRIORITY| Constructor and Description |
|---|
ListenableRouter(org.apache.dubbo.common.URL url,
String ruleKey) |
| Modifier and Type | Method and Description |
|---|---|
int |
getPriority()
Router's priority, used to sort routers.
|
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. |
void |
process(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.
|
getUrl, isRuntime, setForce, setPriority, setUrlpublic static final String NAME
public ListenableRouter(org.apache.dubbo.common.URL url,
String ruleKey)
public void process(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event)
process in interface org.apache.dubbo.common.config.configcenter.ConfigurationListenerpublic <T> List<Invoker<T>> route(List<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation) throws RpcException
Routerroute in interface Routerinvokers - invoker listurl - refer urlinvocation - invocationRpcExceptionpublic int getPriority()
RoutergetPriority in interface RoutergetPriority in class AbstractRouterpublic boolean isForce()
RouterRouter.route(List, URL, Invocation) would be empty. Most of time, most router implementation would
default this value to false.isForce in interface RouterisForce in class AbstractRouterCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.