public abstract class ListenableStateRouter<T> extends AbstractStateRouter<T> implements org.apache.dubbo.common.config.configcenter.ConfigurationListener
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME |
DEFAULT_PRIORITY| Constructor and Description |
|---|
ListenableStateRouter(org.apache.dubbo.common.URL url,
String ruleKey) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isForce()
To decide whether this router should take effect when none of the invoker can match the router rule, which
means the
StateRouter.route(BitList, URL, Invocation, boolean) would be empty. |
void |
process(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event) |
StateRouterResult<Invoker<T>> |
route(BitList<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() |
getPriority, getRuleRepository, getUrl, isRuntime, notify, setForce, setPriority, setUrlequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompareTopublic static final String NAME
public ListenableStateRouter(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 StateRouterResult<Invoker<T>> route(BitList<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation, boolean needToPrintMessage) throws RpcException
StateRouterroute in interface StateRouter<T>invokers - invoker bit listurl - refer urlinvocation - invocationneedToPrintMessage - whether to print router state. Such as `use router branch a`.RpcExceptionpublic boolean isForce()
StateRouterStateRouter.route(BitList, URL, Invocation, boolean) would be empty. Most of time, most router implementation would
default this value to false.isForce in interface StateRouter<T>isForce in class AbstractStateRouter<T>public void stop()
stop in interface StateRouter<T>Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.