public abstract class ListenableStateRouter<T> extends AbstractStateRouter<T> implements org.apache.dubbo.common.config.configcenter.ConfigurationListener
| 构造器和说明 |
|---|
ListenableStateRouter(org.apache.dubbo.common.URL url,
String ruleKey) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 ListenableStateRouter(org.apache.dubbo.common.URL url,
String ruleKey)
public void process(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event)
process 在接口中 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 在接口中 StateRouter<T>isForce 在类中 AbstractStateRouter<T>public void stop()
stop 在接口中 StateRouter<T>Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.