Class BaseDiscoveryService

java.lang.Object
org.apache.sling.discovery.base.commons.BaseDiscoveryService
All Implemented Interfaces:
DiscoveryService
Direct Known Subclasses:
OakDiscoveryService

public abstract class BaseDiscoveryService extends Object implements DiscoveryService
Abstract base class for DiscoveryService implementations which uses the ClusterViewService plus Topology Connectors to calculate the current TopologyView
  • Constructor Details

    • BaseDiscoveryService

      public BaseDiscoveryService()
  • Method Details

    • getClusterViewService

      protected abstract ClusterViewService getClusterViewService()
    • getAnnouncementRegistry

      protected abstract AnnouncementRegistry getAnnouncementRegistry()
    • handleIsolatedFromTopology

      protected abstract void handleIsolatedFromTopology()
    • getOldView

      protected DefaultTopologyView getOldView()
    • setOldView

      protected void setOldView(DefaultTopologyView view)
    • getTopology

      public TopologyView getTopology()
      Description copied from interface: DiscoveryService
      Returns the topology that was last discovered by this service.

      If for some reason the service is currently not able to do topology discovery it will return the last valid topology marked with false in the call to TopologyView.isCurrent(). This is also true if the service has noticed a potential change in the topology and is in the process of settling the change in the topology (eg with peers, ie voting).

      Note that this call is synchronized with TopologyEventListener.handleTopologyEvent() calls: ie if calls to TopologyEventListener.handleTopologyEvent() are currently ongoing, then the call to this method will block until all TopologyEventListeners have been called. Be careful not to cause deadlock situations.

      Specified by:
      getTopology in interface DiscoveryService
      Returns:
      the topology that was last discovered by this service. This will never be null (ie even if a change in the topology is ongoing at the moment or the cluster consists only of the local instance).
      See Also: