org.apache.sling.discovery.impl

## Class DiscoveryServiceImpl

- java.lang.Object
- - org.apache.sling.discovery.base.commons.BaseDiscoveryService
  - - org.apache.sling.discovery.impl.DiscoveryServiceImpl

All Implemented Interfaces:
  org.apache.sling.discovery.DiscoveryService

    @Service(value={org.apache.sling.discovery.DiscoveryService.class,DiscoveryServiceImpl.class})
    public class DiscoveryServiceImpl
    extends org.apache.sling.discovery.base.commons.BaseDiscoveryService

This implementation of the cross-cluster service uses the view manager implementation for detecting changes in a cluster and only supports one cluster (of which this instance is part of).

### Constructor Summary

Constructors
Constructor and Description
`DiscoveryServiceImpl()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected void` `activate(org.osgi.framework.BundleContext bundleContext)` Activate this service
`protected void` `bindPropertyProvider(org.apache.sling.discovery.PropertyProvider propertyProvider, Map<String,Object> props)` Bind a new property provider.
`protected void` `bindTopologyEventListener(org.apache.sling.discovery.TopologyEventListener eventListener)` bind a topology event listener
`void` `checkForLocalClusterViewChange()` only checks for local clusterView changes.
`void` `checkForTopologyChange()` Check the current topology for any potential change
`protected void` `deactivate()` Deactivate this service
`void` `forcedShutdown()` SLING-2901 : send a TOPOLOGY_CHANGING event and shutdown the service thereafter
`protected org.apache.sling.discovery.base.connectors.announcement.AnnouncementRegistry` `getAnnouncementRegistry()`
`protected org.apache.sling.discovery.base.commons.ClusterViewService` `getClusterViewService()`
`ClusterViewServiceImpl` `getClusterViewServiceImpl()`
`protected org.apache.sling.discovery.commons.providers.ViewStateManager` `getViewStateManager()` for testing only
`protected void` `handleIsolatedFromTopology()`
`void` `handleTopologyChanging()` Handle the fact that the topology has started to change - inform the listeners asap
`protected void` `registerMBean(org.osgi.framework.BundleContext bundleContext)`

`static org.apache.sling.discovery.base.commons.BaseDiscoveryService`

`testConstructor(org.apache.sling.api.resource.ResourceResolverFactory resourceResolverFactory, org.apache.sling.discovery.base.connectors.announcement.AnnouncementRegistry announcementRegistry, org.apache.sling.discovery.base.connectors.ping.ConnectorRegistry connectorRegistry, ClusterViewServiceImpl clusterViewService, HeartbeatHandler heartbeatHandler, org.apache.sling.settings.SlingSettingsService settingsService, org.apache.sling.commons.scheduler.Scheduler scheduler, Config config, org.apache.sling.discovery.commons.providers.spi.base.SyncTokenService syncTokenServiceOrNull)`
for testing only

`protected void` `unbindPropertyProvider(org.apache.sling.discovery.PropertyProvider propertyProvider, Map<String,Object> props)` Unbind a property provider
`protected void` `unbindTopologyEventListener(org.apache.sling.discovery.TopologyEventListener eventListener)` Unbind a topology event listener
`protected void` `updatedPropertyProvider(org.apache.sling.discovery.PropertyProvider propertyProvider, Map<String,Object> props)` Update a property provider.
`void` `updateProperties()` Update the properties and sent a topology event if applicable

### Methods inherited from class org.apache.sling.discovery.base.commons.BaseDiscoveryService

`getOldView, getTopology, setOldView`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DiscoveryServiceImpl

    public DiscoveryServiceImpl()

### Method Detail

#### testConstructor

    public static org.apache.sling.discovery.base.commons.BaseDiscoveryService testConstructor(org.apache.sling.api.resource.ResourceResolverFactory resourceResolverFactory,
                                                                                               org.apache.sling.discovery.base.connectors.announcement.AnnouncementRegistry announcementRegistry,
                                                                                               org.apache.sling.discovery.base.connectors.ping.ConnectorRegistry connectorRegistry,
                                                                                               ClusterViewServiceImpl clusterViewService,
                                                                                               HeartbeatHandler heartbeatHandler,
                                                                                               org.apache.sling.settings.SlingSettingsService settingsService,
                                                                                               org.apache.sling.commons.scheduler.Scheduler scheduler,
                                                                                               Config config,
                                                                                               org.apache.sling.discovery.commons.providers.spi.base.SyncTokenService syncTokenServiceOrNull)

for testing only

#### registerMBean

    protected void registerMBean(org.osgi.framework.BundleContext bundleContext)

#### handleIsolatedFromTopology

    protected void handleIsolatedFromTopology()

Specified by:
  `handleIsolatedFromTopology` in class `org.apache.sling.discovery.base.commons.BaseDiscoveryService`

#### activate

    @Activate
    protected void activate(org.osgi.framework.BundleContext bundleContext)

Activate this service

#### deactivate

    @Deactivate
    protected void deactivate()

Deactivate this service

#### bindTopologyEventListener

    protected void bindTopologyEventListener(org.apache.sling.discovery.TopologyEventListener eventListener)

bind a topology event listener

#### unbindTopologyEventListener

    protected void unbindTopologyEventListener(org.apache.sling.discovery.TopologyEventListener eventListener)

Unbind a topology event listener

#### bindPropertyProvider

    protected void bindPropertyProvider(org.apache.sling.discovery.PropertyProvider propertyProvider,
                                        Map<String,Object> props)

Bind a new property provider.

#### updatedPropertyProvider

    protected void updatedPropertyProvider(org.apache.sling.discovery.PropertyProvider propertyProvider,
                                           Map<String,Object> props)

Update a property provider.

#### unbindPropertyProvider

    protected void unbindPropertyProvider(org.apache.sling.discovery.PropertyProvider propertyProvider,
                                          Map<String,Object> props)

Unbind a property provider

#### updateProperties

    public void updateProperties()

Update the properties and sent a topology event if applicable

#### checkForLocalClusterViewChange

    public void checkForLocalClusterViewChange()

only checks for local clusterView changes. thus eg avoids doing synchronized with annotationregistry

#### checkForTopologyChange

    public void checkForTopologyChange()

Check the current topology for any potential change

#### handleTopologyChanging

    public void handleTopologyChanging()

Handle the fact that the topology has started to change - inform the listeners asap

#### forcedShutdown

    public void forcedShutdown()

SLING-2901 : send a TOPOLOGY_CHANGING event and shutdown the service thereafter

#### getClusterViewService

    protected org.apache.sling.discovery.base.commons.ClusterViewService getClusterViewService()

Specified by:
  `getClusterViewService` in class `org.apache.sling.discovery.base.commons.BaseDiscoveryService`

#### getClusterViewServiceImpl

    public ClusterViewServiceImpl getClusterViewServiceImpl()

#### getAnnouncementRegistry

    protected org.apache.sling.discovery.base.connectors.announcement.AnnouncementRegistry getAnnouncementRegistry()

Specified by:
  `getAnnouncementRegistry` in class `org.apache.sling.discovery.base.commons.BaseDiscoveryService`

#### getViewStateManager

    protected org.apache.sling.discovery.commons.providers.ViewStateManager getViewStateManager()

for testing only

Returns: