public abstract class ListenableStateRouter<T> extends AbstractStateRouter<T> implements org.apache.dubbo.common.config.configcenter.ConfigurationListener
| Constructor and Description |
|---|
ListenableStateRouter(org.apache.dubbo.common.URL url,
String ruleKey) |
| Modifier and Type | Method and Description |
|---|---|
BitList<Invoker<T>> |
doRoute(BitList<Invoker<T>> invokers,
org.apache.dubbo.common.URL url,
Invocation invocation,
boolean needToPrintMessage,
org.apache.dubbo.common.utils.Holder<RouterSnapshotNode<T>> nodeHolder,
org.apache.dubbo.common.utils.Holder<String> messageHolder)
Filter invokers with current routing rule and only return the invokers that comply with the rule.
|
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, Holder) would be empty. |
void |
process(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event) |
void |
stop() |
buildSnapshot, getNextRouter, getRuleRepository, getUrl, isRuntime, notify, route, setForce, setNextRouter, setUrlpublic 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 BitList<Invoker<T>> doRoute(BitList<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation, boolean needToPrintMessage, org.apache.dubbo.common.utils.Holder<RouterSnapshotNode<T>> nodeHolder, org.apache.dubbo.common.utils.Holder<String> messageHolder) throws RpcException
AbstractStateRouterinvokers - all invokers to be routedurl - consumerUrlinvocation - invocationneedToPrintMessage - should current router print messagenodeHolder - RouterSnapshotNode In general, router itself no need to care this param, just pass to continueRoutemessageHolder - message holder when router should current router print messageRpcExceptionpublic boolean isForce()
StateRouterStateRouter.route(BitList, URL, Invocation, boolean, Holder) 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–2022 The Apache Software Foundation. All rights reserved.