public interface Router extends Comparable<Router>
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_PRIORITY |
| 限定符和类型 | 方法和说明 |
|---|---|
default int |
compareTo(Router o) |
int |
getPriority()
Router's priority, used to sort routers.
|
org.apache.dubbo.common.URL |
getUrl()
Get the router url.
|
boolean |
isForce()
To decide whether this router should take effect when none of the invoker can match the router rule, which
means the
route(List, URL, Invocation) 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.
|
default <T> void |
notify(List<Invoker<T>> invokers)
Notify the router the invoker list.
|
<T> List<Invoker<T>> |
route(List<Invoker<T>> invokers,
org.apache.dubbo.common.URL url,
Invocation invocation)
Filter invokers with current routing rule and only return the invokers that comply with the rule.
|
static final int DEFAULT_PRIORITY
org.apache.dubbo.common.URL getUrl()
<T> List<Invoker<T>> route(List<Invoker<T>> invokers, org.apache.dubbo.common.URL url, Invocation invocation) throws RpcException
invokers - invoker listurl - refer urlinvocation - invocationRpcExceptiondefault <T> void notify(List<Invoker<T>> invokers)
route(List, URL, Invocation) gets called.T - invoker's typeinvokers - invoker listboolean isRuntime()
boolean isForce()
route(List, URL, Invocation) would be empty. Most of time, most router implementation would
default this value to false.int getPriority()
default int compareTo(Router o)
compareTo 在接口中 Comparable<Router>Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.