public class TagStateRouter<T> extends AbstractStateRouter<T> implements org.apache.dubbo.common.config.configcenter.ConfigurationListener
| 构造器和说明 |
|---|
TagStateRouter(org.apache.dubbo.common.URL url) |
| 限定符和类型 | 方法和说明 |
|---|---|
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. |
boolean |
isRuntime()
To decide whether this router need to execute every time an RPC comes or should only execute when addresses or
rule change.
|
void |
notify(BitList<Invoker<T>> invokers)
Notify the router the invoker list.
|
void |
process(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event) |
void |
setApplication(String app) |
void |
stop() |
buildSnapshot, getNextRouter, getRuleRepository, getUrl, route, setForce, setNextRouter, setUrlpublic 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 isRuntime()
StateRouterisRuntime 在接口中 StateRouter<T>isRuntime 在类中 AbstractStateRouter<T>public 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 setApplication(String app)
public void notify(BitList<Invoker<T>> invokers)
StateRouterStateRouter.route(BitList, URL, Invocation, boolean, Holder) gets called.
No need to notify next node.notify 在接口中 StateRouter<T>notify 在类中 AbstractStateRouter<T>invokers - invoker listpublic void stop()
stop 在接口中 StateRouter<T>Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.