public class ConditionStateRouter<T> extends AbstractStateRouter<T>
ServiceRouter
and AppStateRouter
refer to https://dubbo.apache.org/zh/docs/v2.7/user/examples/routing-rule/ .| Modifier and Type | Field and Description |
|---|---|
static String |
NAME |
DEFAULT_PRIORITY| Constructor and Description |
|---|
ConditionStateRouter(org.apache.dubbo.common.URL url) |
ConditionStateRouter(org.apache.dubbo.common.URL url,
String rule,
boolean force,
boolean enabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
init(String rule) |
boolean |
isRuntime()
To decide whether this router need to execute every time an RPC comes or should only execute when addresses or
rule change.
|
boolean |
matchArguments(Map.Entry<String,org.apache.dubbo.rpc.cluster.router.condition.ConditionStateRouter.MatchPair> matchPair,
Invocation invocation)
analysis the arguments in the rule.
|
StateRouterResult<Invoker<T>> |
route(BitList<Invoker<T>> invokers,
org.apache.dubbo.common.URL url,
Invocation invocation,
boolean needToPrintMessage)
** This method can return the state of whether routerChain needed to continue route.
|
getPriority, getRuleRepository, getUrl, isForce, notify, setForce, setPriority, setUrlequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompareTo, stoppublic static final String NAME
public ConditionStateRouter(org.apache.dubbo.common.URL url,
String rule,
boolean force,
boolean enabled)
public ConditionStateRouter(org.apache.dubbo.common.URL url)
public void init(String rule)
public StateRouterResult<Invoker<T>> route(BitList<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation, boolean needToPrintMessage) throws RpcException
StateRouterinvokers - invoker bit listurl - refer urlinvocation - invocationneedToPrintMessage - whether to print router state. Such as `use router branch a`.RpcExceptionpublic boolean isRuntime()
StateRouterisRuntime in interface StateRouter<T>isRuntime in class AbstractStateRouter<T>public boolean matchArguments(Map.Entry<String,org.apache.dubbo.rpc.cluster.router.condition.ConditionStateRouter.MatchPair> matchPair, Invocation invocation)
matchPair - invocation - Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.