public class RouterChain<T> extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addRouters(List<Router> routers)
If we use route:// protocol in version before 2.7.0, each URL will generate a Router instance, so we should
keep the routers up to date, that is, each time router URLs changes, we should update the routers list, only
keep the builtinRouters which are available all the time and the latest notified routers which are generated
from URLs.
|
void |
addStateRouters(List<StateRouter> stateRouters) |
static <T> RouterChain<T> |
buildChain(org.apache.dubbo.common.URL url) |
void |
destroy() |
List<Router> |
getRouters() |
List<StateRouter> |
getStateRouters() |
void |
initWithRouters(List<Router> builtinRouters)
the resident routers must being initialized before address notification.
|
void |
loop(boolean notify)
Build the asynchronous address cache for stateRouter.
|
List<Invoker<T>> |
route(org.apache.dubbo.common.URL url,
Invocation invocation) |
void |
setInvokers(List<Invoker<T>> invokers)
Notify router chain of the initial addresses from registry at the first time.
|
public static <T> RouterChain<T> buildChain(org.apache.dubbo.common.URL url)
public void initWithRouters(List<Router> builtinRouters)
public void addRouters(List<Router> routers)
routers - routers from 'router://' rules in 2.6.x or before.public void addStateRouters(List<StateRouter> stateRouters)
public List<StateRouter> getStateRouters()
public List<Invoker<T>> route(org.apache.dubbo.common.URL url, Invocation invocation)
url - invocation - public void setInvokers(List<Invoker<T>> invokers)
public void loop(boolean notify)
notify - Whether the addresses in registry has changed.public void destroy()
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.