public class ScriptStateRouter<T> extends AbstractStateRouter<T>
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME |
DEFAULT_PRIORITY| Constructor and Description |
|---|
ScriptStateRouter(org.apache.dubbo.common.URL url) |
| Modifier and Type | Method and Description |
|---|---|
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) 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.
|
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, notify, setForce, setPriority, setUrlequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompareTo, stoppublic static final String NAME
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 isForce()
StateRouterStateRouter.route(BitList, URL, Invocation, boolean) would be empty. Most of time, most router implementation would
default this value to false.isForce in interface StateRouter<T>isForce in class AbstractStateRouter<T>Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.