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

public abstract class AbstractDirectory<T> extends Object implements Directory<T>
Abstract implementation of Directory: Invoker list returned from this Directory's list method have been filtered by Routers
  • 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

      public List<Invoker<T>> list(Invocation invocation) throws RpcException
      Description copied from interface: Directory
      list invokers. filtered by invocation
      Specified by:
      list in interface Directory<T>
      Returns:
      invokers
      Throws:
      RpcException
    • getUrl

      public org.apache.dubbo.common.URL getUrl()
      Specified by:
      getUrl in interface org.apache.dubbo.common.Node
    • getRouterChain

      public RouterChain<T> getRouterChain()
      Specified by:
      getRouterChain in interface Directory<T>
    • setRouterChain

      public void setRouterChain(RouterChain<T> routerChain)
    • getConsumerUrl

      public org.apache.dubbo.common.URL getConsumerUrl()
      Specified by:
      getConsumerUrl in interface Directory<T>
    • setConsumerUrl

      public void setConsumerUrl(org.apache.dubbo.common.URL consumerUrl)
    • isDestroyed

      public boolean isDestroyed()
      Specified by:
      isDestroyed in interface Directory<T>
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.apache.dubbo.common.Node
    • discordAddresses

      public void discordAddresses()
      Specified by:
      discordAddresses in interface Directory<T>
    • addInvalidateInvoker

      public void addInvalidateInvoker(Invoker<T> invoker)
      Description copied from interface: Directory
      invalidate 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:
      addInvalidateInvoker in interface Directory<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

      public void addDisabledInvoker(Invoker<T> invoker)
      Description copied from interface: Directory
      disable 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:
      addDisabledInvoker in interface Directory<T>
      Parameters:
      invoker - invoker to invalidate
    • recoverDisabledInvoker

      public void recoverDisabledInvoker(Invoker<T> invoker)
      Description copied from interface: Directory
      recover a disabled invoker
      Specified by:
      recoverDisabledInvoker in interface Directory<T>
      Parameters:
      invoker - invoker to invalidate
    • getCheckConnectivityPermit

      @Deprecated public Semaphore getCheckConnectivityPermit()
      Deprecated.
      for ut only
    • getConnectivityCheckFuture

      @Deprecated public ScheduledFuture<?> getConnectivityCheckFuture()
      Deprecated.
      for ut only
    • getInvokers

      public BitList<Invoker<T>> getInvokers()
    • getValidInvokers

      public BitList<Invoker<T>> getValidInvokers()
    • getInvokersToReconnect

      public List<Invoker<T>> getInvokersToReconnect()
    • getDisabledInvokers

      public Set<Invoker<T>> getDisabledInvokers()
    • toString

      public String toString()
      Overrides:
      toString in class Object