类 RouterChain<T>
- java.lang.Object
-
- org.apache.dubbo.rpc.cluster.RouterChain<T>
-
public class RouterChain<T> extends Object
Router chain
-
-
构造器概要
构造器 构造器 说明 RouterChain(List<Router> routers, List<StateRouter<T>> stateRouters, boolean shouldFailFast, RouterSnapshotSwitcher routerSnapshotSwitcher)
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 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.static <T> RouterChain<T>buildChain(Class<T> interfaceClass, org.apache.dubbo.common.URL url)RouterSnapshotNode<T>buildRouterSnapshot(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)Build each router's resultvoiddestroy()StateRouter<T>getHeadStateRouter()List<Router>getRouters()List<StateRouter<T>>getStateRouters()已过时。voidinitWithRouters(List<Router> builtinRouters)the resident routers must being initialized before address notification.List<Invoker<T>>route(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)List<Invoker<T>>routeAndPrint(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)voidsetHeadStateRouter(StateRouter<T> headStateRouter)已过时。voidsetInvokers(BitList<Invoker<T>> invokers)Notify router chain of the initial addresses from registry at the first time.List<Invoker<T>>simpleRoute(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
-
-
-
构造器详细资料
-
RouterChain
public RouterChain(List<Router> routers, List<StateRouter<T>> stateRouters, boolean shouldFailFast, RouterSnapshotSwitcher routerSnapshotSwitcher)
-
-
方法详细资料
-
buildChain
public static <T> RouterChain<T> buildChain(Class<T> interfaceClass, org.apache.dubbo.common.URL url)
-
initWithRouters
public void initWithRouters(List<Router> builtinRouters)
the resident routers must being initialized before address notification. only for ut
-
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.
-
getHeadStateRouter
public StateRouter<T> getHeadStateRouter()
-
route
public List<Invoker<T>> route(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
-
routeAndPrint
public List<Invoker<T>> routeAndPrint(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
-
simpleRoute
public List<Invoker<T>> simpleRoute(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
-
buildRouterSnapshot
public RouterSnapshotNode<T> buildRouterSnapshot(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
Build each router's result
-
setInvokers
public void setInvokers(BitList<Invoker<T>> invokers)
Notify router chain of the initial addresses from registry at the first time. Notify whenever addresses in registry change.
-
setHeadStateRouter
@Deprecated public void setHeadStateRouter(StateRouter<T> headStateRouter)
已过时。for uts only
-
getStateRouters
@Deprecated public List<StateRouter<T>> getStateRouters()
已过时。for uts only
-
destroy
public void destroy()
-
-