类 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 to org.apache.dubbo.rpc.cluster.router.condition.config.ServiceRouter and AppStateRouter refer to https://dubbo.apache.org/zh/docs/v2.7/user/examples/routing-rule/ .
    • 构造器详细资料

      • 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()
        从接口复制的说明: StateRouter
        To 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 -
        返回: