类 RouterChain<T>
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.RouterChain<T>
-
public class RouterChain<T> extends Object
Router chain
-
-
字段概要
字段 修饰符和类型 字段 说明 static org.apache.dubbo.common.logger.LoggerLOGGER
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddRouters(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.voidaddStateRouters(List<StateRouter> stateRouters)static <T> RouterChain<T>buildChain(org.apache.dubbo.common.URL url)voiddestroy()List<Router>getRouters()voidinitWithRouters(List<Router> builtinRouters)the resident routers must being initialized before address notification.voidinitWithStateRouters(List<StateRouter> builtinRouters)voidloop(boolean notify)Build the asynchronous address cache for stateRouter.List<Invoker<T>>route(org.apache.dubbo.common.URL url, Invocation invocation)voidsetInvokers(List<Invoker<T>> invokers)Notify router chain of the initial addresses from registry at the first time.
-
-
-
方法详细资料
-
buildChain
public static <T> RouterChain<T> buildChain(org.apache.dubbo.common.URL url)
-
initWithRouters
public void initWithRouters(List<Router> builtinRouters)
the resident routers must being initialized before address notification. FIXME: this method should not be public
-
initWithStateRouters
public void initWithStateRouters(List<StateRouter> builtinRouters)
-
addRouters
public 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.- 参数:
routers- routers from 'router://' rules in 2.6.x or before.
-
addStateRouters
public void addStateRouters(List<StateRouter> stateRouters)
-
route
public List<Invoker<T>> route(org.apache.dubbo.common.URL url, Invocation invocation)
- 参数:
url-invocation-- 返回:
-
setInvokers
public void setInvokers(List<Invoker<T>> invokers)
Notify router chain of the initial addresses from registry at the first time. Notify whenever addresses in registry change.
-
loop
public void loop(boolean notify)
Build the asynchronous address cache for stateRouter.- 参数:
notify- Whether the addresses in registry has changed.
-
destroy
public void destroy()
-
-