类 ConditionStateRouter<T>
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.router.state.AbstractStateRouter<T>
-
- org.apache.dubbo.rpc.cluster.router.condition.ConditionStateRouter<T>
-
- 所有已实现的接口:
StateRouter<T>
public class ConditionStateRouter<T> extends AbstractStateRouter<T>
ConditionRouter It supports the conditional routing configured by "override://", in 2.6.x, refer to https://dubbo.apache.org/en/docs/v2.7/user/examples/routing-rule/ . For 2.7.x and later, please refer toorg.apache.dubbo.rpc.cluster.router.condition.config.ServiceRouterandAppStateRouterrefer to https://dubbo.apache.org/zh/docs/v2.7/user/examples/routing-rule/ .
-
-
构造器概要
构造器 构造器 说明 ConditionStateRouter(org.apache.dubbo.common.URL url)ConditionStateRouter(org.apache.dubbo.common.URL url, String rule, boolean force, boolean enabled)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidinit(String rule)booleanisRuntime()To decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.booleanmatchArguments(Map.Entry<String,org.apache.dubbo.rpc.cluster.router.condition.ConditionStateRouter.MatchPair> matchPair, Invocation invocation)analysis the arguments in the rule.-
从类继承的方法 org.apache.dubbo.rpc.cluster.router.state.AbstractStateRouter
buildSnapshot, getNextRouter, getRuleRepository, getUrl, isForce, notify, route, setForce, setNextRouter, setUrl
-
从接口继承的方法 org.apache.dubbo.rpc.cluster.router.state.StateRouter
stop
-
-
-
-
构造器详细资料
-
ConditionStateRouter
public ConditionStateRouter(org.apache.dubbo.common.URL url, String rule, boolean force, boolean enabled)
-
ConditionStateRouter
public ConditionStateRouter(org.apache.dubbo.common.URL url)
-
-
方法详细资料
-
init
public void init(String rule)
-
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.
-
matchArguments
public boolean matchArguments(Map.Entry<String,org.apache.dubbo.rpc.cluster.router.condition.ConditionStateRouter.MatchPair> matchPair, Invocation invocation)
analysis the arguments in the rule. Examples would be like this: "arguments[0]=1", whenCondition is that the first argument is equal to '1'. "arguments[1]=a", whenCondition is that the second argument is equal to 'a'.- 参数:
matchPair-invocation-- 返回:
-
-