Class BaseDiscoveryService
java.lang.Object
org.apache.sling.discovery.base.commons.BaseDiscoveryService
- All Implemented Interfaces:
DiscoveryService
- Direct Known Subclasses:
OakDiscoveryService
Abstract base class for DiscoveryService implementations which uses the
ClusterViewService plus Topology Connectors to calculate
the current TopologyView
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AnnouncementRegistryprotected abstract ClusterViewServiceprotected DefaultTopologyViewReturns the topology that was last discovered by this service.protected abstract voidprotected void
-
Constructor Details
-
BaseDiscoveryService
public BaseDiscoveryService()
-
-
Method Details
-
getClusterViewService
-
getAnnouncementRegistry
-
handleIsolatedFromTopology
protected abstract void handleIsolatedFromTopology() -
getOldView
-
setOldView
-
getTopology
Description copied from interface:DiscoveryServiceReturns 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
falsein the call toTopologyView.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 toTopologyEventListener.handleTopologyEvent()are currently ongoing, then the call to this method will block until allTopologyEventListeners have been called. Be careful not to cause deadlock situations.- Specified by:
getTopologyin interfaceDiscoveryService- 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:
-