public class SingleRouterChain<T> extends Object
| 构造器和说明 |
|---|
SingleRouterChain(List<Router> routers,
List<StateRouter<T>> stateRouters,
boolean shouldFailFast,
RouterSnapshotSwitcher routerSnapshotSwitcher) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
RouterSnapshotNode<T> |
buildRouterSnapshot(org.apache.dubbo.common.URL url,
BitList<Invoker<T>> availableInvokers,
Invocation invocation)
Build each router's result
|
void |
destroy() |
StateRouter<T> |
getHeadStateRouter() |
ReadWriteLock |
getLock() |
List<Router> |
getRouters() |
List<StateRouter<T>> |
getStateRouters()
已过时。
|
void |
initWithRouters(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) |
void |
setHeadStateRouter(StateRouter<T> headStateRouter)
已过时。
|
void |
setInvokers(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) |
public SingleRouterChain(List<Router> routers, List<StateRouter<T>> stateRouters, boolean shouldFailFast, RouterSnapshotSwitcher routerSnapshotSwitcher)
public void initWithRouters(List<Router> builtinRouters)
public void addRouters(List<Router> routers)
routers - routers from 'router://' rules in 2.6.x or before.public StateRouter<T> getHeadStateRouter()
public List<Invoker<T>> route(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
public List<Invoker<T>> routeAndPrint(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
public List<Invoker<T>> simpleRoute(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
public RouterSnapshotNode<T> buildRouterSnapshot(org.apache.dubbo.common.URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation)
public void setInvokers(BitList<Invoker<T>> invokers)
@Deprecated public void setHeadStateRouter(StateRouter<T> headStateRouter)
@Deprecated public List<StateRouter<T>> getStateRouters()
public ReadWriteLock getLock()
public void destroy()
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.