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
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AnnouncementRegistry
protected abstract ClusterViewService
protected DefaultTopologyView
Returns the topology that was last discovered by this service.protected abstract void
protected void
-
Constructor Details
-
BaseDiscoveryService
public BaseDiscoveryService()
-
-
Method Details
-
getClusterViewService
-
getAnnouncementRegistry
-
handleIsolatedFromTopology
protected abstract void handleIsolatedFromTopology() -
getOldView
-
setOldView
-
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 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 allTopologyEventListener
s have been called. Be careful not to cause deadlock situations.- Specified by:
getTopology
in 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:
-