Class OakViewChecker
java.lang.Object
org.apache.sling.discovery.base.commons.BaseViewChecker
org.apache.sling.discovery.oak.pinger.OakViewChecker
- All Implemented Interfaces:
Runnable,ViewChecker
The OakViewChecker is taking care of checking the oak discovery-lite
descriptor when checking the local cluster view and passing that
on to the ViewStateManager which will then detect whether there was
any change or not. Unlike discovery.impl's HeartbeatHandler this one
does not store any heartbeats in the repository anymore.
Remote heartbeats are POSTs to remote TopologyConnectorServlets using discovery.base
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AnnouncementRegistryprotected ConnectorRegistryprotected PeriodicBackgroundJobprotected ResourceResolverFactoryprotected Schedulerprotected SlingSettingsServiceFields inherited from class org.apache.sling.discovery.base.commons.BaseViewChecker
activated, context, endpoints, lock, logger, NAME, periodicPingJob, PROPERTY_ID_ENDPOINTS, PROPERTY_ID_RUNTIME, PROPERTY_ID_SLING_HOME_PATH, runtimeId, slingId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidCheck whether the established view matches the reality, ie matches the heartbeatsprotected AnnouncementRegistryprotected BaseConfigprotected ConnectorRegistryprotected ResourceResolverFactoryprotected Schedulerprotected SlingSettingsServicevoidinitialize(OakDiscoveryService discoveryService) The initialize method is called by the OakDiscoveryService.activate as we require the discoveryService (and the discoveryService has a reference on us - but we cant have circular references in osgi).booleanHook that will cause a reset of the leaderElectionId on next invocation of issueClusterLocalHeartbeat.static OakViewCheckertestConstructor(SlingSettingsService slingSettingsService, ResourceResolverFactory resourceResolverFactory, ConnectorRegistry connectorRegistry, AnnouncementRegistry announcementRegistry, Scheduler scheduler, Config config) for testing onlyprotected voidMethods inherited from class org.apache.sling.discovery.base.commons.BaseViewChecker
activate, bindHttpService, checkView, getEndpointsAsString, heartbeatAndCheckView, issueConnectorPings, issueHeartbeat, run, triggerAsyncConnectorPing, unbindHttpService
-
Field Details
-
slingSettingsService
-
resourceResolverFactory
-
connectorRegistry
-
announcementRegistry
-
scheduler
-
periodicCheckViewJob
-
-
Constructor Details
-
OakViewChecker
public OakViewChecker()
-
-
Method Details
-
testConstructor
public static OakViewChecker testConstructor(SlingSettingsService slingSettingsService, ResourceResolverFactory resourceResolverFactory, ConnectorRegistry connectorRegistry, AnnouncementRegistry announcementRegistry, Scheduler scheduler, Config config) for testing only -
getAnnouncementRegistry
- Specified by:
getAnnouncementRegistryin classBaseViewChecker
-
getConnectorConfig
- Specified by:
getConnectorConfigin classBaseViewChecker
-
getConnectorRegistry
- Specified by:
getConnectorRegistryin classBaseViewChecker
-
getResourceResolverFactory
- Specified by:
getResourceResolverFactoryin classBaseViewChecker
-
getScheduler
- Specified by:
getSchedulerin classBaseViewChecker
-
getSlingSettingsService
- Specified by:
getSlingSettingsServicein classBaseViewChecker
-
doActivate
protected void doActivate()- Overrides:
doActivatein classBaseViewChecker
-
deactivate
protected void deactivate()- Overrides:
deactivatein classBaseViewChecker
-
initialize
The initialize method is called by the OakDiscoveryService.activate as we require the discoveryService (and the discoveryService has a reference on us - but we cant have circular references in osgi). -
resetLeaderElectionId
public boolean resetLeaderElectionId()Hook that will cause a reset of the leaderElectionId on next invocation of issueClusterLocalHeartbeat.- Returns:
- true if the leaderElectionId was reset - false if that was not necessary as that happened earlier already and it has not propagated yet to the ./clusterInstances in the meantime
-
doCheckView
protected void doCheckView()Description copied from class:BaseViewCheckerCheck whether the established view matches the reality, ie matches the heartbeats- Overrides:
doCheckViewin classBaseViewChecker
-
updateProperties
protected void updateProperties()- Specified by:
updatePropertiesin classBaseViewChecker
-