Class AbstractDirectory<T>
java.lang.Object
org.apache.dubbo.rpc.cluster.directory.AbstractDirectory<T>
- All Implemented Interfaces:
org.apache.dubbo.common.Node,Directory<T>
- Direct Known Subclasses:
StaticDirectory
Abstract implementation of Directory: Invoker list returned from this Directory's list method have been filtered by Routers
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDirectory(org.apache.dubbo.common.URL url) AbstractDirectory(org.apache.dubbo.common.URL url, boolean isUrlFromRegistry) AbstractDirectory(org.apache.dubbo.common.URL url, RouterChain<T> routerChain, boolean isUrlFromRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDisabledInvoker(Invoker<T> invoker) disable an invoker, remove from list next time will be removed when invoker is removed by address refresh notification using in service offline notificationvoidaddInvalidateInvoker(Invoker<T> invoker) invalidate an invoker, add it into reconnect task, remove from list next time will be recovered by address refresh notification or reconnect success notificationvoidvoiddestroy()voidDeprecated.Deprecated.org.apache.dubbo.common.URLorg.apache.dubbo.common.URLgetUrl()booleanlist(Invocation invocation) list invokers.voidrecoverDisabledInvoker(Invoker<T> invoker) recover a disabled invokervoidRefresh invokers from total invokers 1. all the invokers in need to reconnect list should be removed in the valid invokers list 2. all the invokers in disabled invokers list should be removed in the valid invokers list 3. all the invokers disappeared from total invokers should be removed in the need to reconnect list 4. all the invokers disappeared from total invokers should be removed in the disabled invokers listvoidsetConsumerUrl(org.apache.dubbo.common.URL consumerUrl) voidsetRouterChain(RouterChain<T> routerChain) toString()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.dubbo.rpc.cluster.Directory
getAllInvokers, getInterface, isEmpty, isNotificationReceived, isServiceDiscoveryMethods inherited from interface org.apache.dubbo.common.Node
isAvailable
-
Constructor Details
-
AbstractDirectory
public AbstractDirectory(org.apache.dubbo.common.URL url) -
AbstractDirectory
public AbstractDirectory(org.apache.dubbo.common.URL url, boolean isUrlFromRegistry) -
AbstractDirectory
public AbstractDirectory(org.apache.dubbo.common.URL url, RouterChain<T> routerChain, boolean isUrlFromRegistry)
-
-
Method Details
-
list
Description copied from interface:Directorylist invokers. filtered by invocation- Specified by:
listin interfaceDirectory<T>- Returns:
- invokers
- Throws:
RpcException
-
getUrl
public org.apache.dubbo.common.URL getUrl()- Specified by:
getUrlin interfaceorg.apache.dubbo.common.Node
-
getRouterChain
- Specified by:
getRouterChainin interfaceDirectory<T>
-
setRouterChain
-
getConsumerUrl
public org.apache.dubbo.common.URL getConsumerUrl()- Specified by:
getConsumerUrlin interfaceDirectory<T>
-
setConsumerUrl
public void setConsumerUrl(org.apache.dubbo.common.URL consumerUrl) -
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDirectory<T>
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.apache.dubbo.common.Node
-
discordAddresses
public void discordAddresses()- Specified by:
discordAddressesin interfaceDirectory<T>
-
addInvalidateInvoker
Description copied from interface:Directoryinvalidate an invoker, add it into reconnect task, remove from list next time will be recovered by address refresh notification or reconnect success notification- Specified by:
addInvalidateInvokerin interfaceDirectory<T>- Parameters:
invoker- invoker to invalidate
-
checkConnectivity
public void checkConnectivity() -
refreshInvoker
public void refreshInvoker()Refresh invokers from total invokers 1. all the invokers in need to reconnect list should be removed in the valid invokers list 2. all the invokers in disabled invokers list should be removed in the valid invokers list 3. all the invokers disappeared from total invokers should be removed in the need to reconnect list 4. all the invokers disappeared from total invokers should be removed in the disabled invokers list -
addDisabledInvoker
Description copied from interface:Directorydisable an invoker, remove from list next time will be removed when invoker is removed by address refresh notification using in service offline notification- Specified by:
addDisabledInvokerin interfaceDirectory<T>- Parameters:
invoker- invoker to invalidate
-
recoverDisabledInvoker
Description copied from interface:Directoryrecover a disabled invoker- Specified by:
recoverDisabledInvokerin interfaceDirectory<T>- Parameters:
invoker- invoker to invalidate
-
getCheckConnectivityPermit
Deprecated.for ut only -
getConnectivityCheckFuture
Deprecated.for ut only -
getInvokers
-
getValidInvokers
-
getInvokersToReconnect
-
getDisabledInvokers
-
toString
-