类 TagStateRouter<T>
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.router.state.AbstractStateRouter<T>
-
- org.apache.dubbo.rpc.cluster.router.tag.TagStateRouter<T>
-
- 所有已实现的接口:
EventListener,org.apache.dubbo.common.config.configcenter.ConfigurationListener,StateRouter<T>
public class TagStateRouter<T> extends AbstractStateRouter<T> implements org.apache.dubbo.common.config.configcenter.ConfigurationListener
TagRouter, "application.tag-router"
-
-
构造器概要
构造器 构造器 说明 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)booleanisForce()To decide whether this router should take effect when none of the invoker can match the router rule, which means theStateRouter.route(BitList, URL, Invocation, boolean, Holder)would be empty.booleanisRuntime()To decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.voidnotify(BitList<Invoker<T>> invokers)Notify the router the invoker list.voidprocess(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event)voidsetApplication(String app)voidstop()-
从类继承的方法 org.apache.dubbo.rpc.cluster.router.state.AbstractStateRouter
buildSnapshot, getNextRouter, getRuleRepository, getUrl, route, setForce, setNextRouter, setUrl
-
-
-
-
方法详细资料
-
process
public void process(org.apache.dubbo.common.config.configcenter.ConfigChangedEvent event)
- 指定者:
process在接口中org.apache.dubbo.common.config.configcenter.ConfigurationListener
-
doRoute
public 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
- 抛出:
RpcException
-
isRuntime
public boolean isRuntime()
从接口复制的说明:StateRouterTo decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.- 指定者:
isRuntime在接口中StateRouter<T>- 覆盖:
isRuntime在类中AbstractStateRouter<T>- 返回:
- true if the router need to execute every time.
-
isForce
public boolean isForce()
从接口复制的说明:StateRouterTo decide whether this router should take effect when none of the invoker can match the router rule, which means theStateRouter.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>- 返回:
- true to execute if none of invokers matches the current router
-
setApplication
public void setApplication(String app)
-
notify
public void notify(BitList<Invoker<T>> invokers)
从接口复制的说明:StateRouterNotify the router the invoker list. Invoker list may change from time to time. This method gives the router a chance to prepare beforeStateRouter.route(BitList, URL, Invocation, boolean, Holder)gets called. No need to notify next node.- 指定者:
notify在接口中StateRouter<T>- 覆盖:
notify在类中AbstractStateRouter<T>- 参数:
invokers- invoker list
-
stop
public void stop()
- 指定者:
stop在接口中StateRouter<T>
-
-