public abstract class BaseViewChecker extends java.lang.Object implements ViewChecker, java.lang.Runnable
Local heartbeats are stored in the repository. Remote heartbeats are POSTs to remote TopologyConnectorServlets.
Modifier and Type | Field and Description |
---|---|
protected boolean |
activated
SLING-2895: avoid heartbeats after deactivation
|
protected org.osgi.service.component.ComponentContext |
context
keep a reference to the component context
|
protected java.util.Map<java.lang.Long,java.lang.String[]> |
endpoints
SLING-4765 : store endpoints to /clusterInstances for more verbose duplicate slingId/ghost detection
|
protected java.lang.Object |
lock
lock object for synchronizing the run method
|
protected org.slf4j.Logger |
logger |
protected java.lang.String |
NAME
the name used for the period job with the scheduler
|
protected PeriodicBackgroundJob |
periodicPingJob |
protected static java.lang.String |
PROPERTY_ID_ENDPOINTS |
protected static java.lang.String |
PROPERTY_ID_RUNTIME |
protected static java.lang.String |
PROPERTY_ID_SLING_HOME_PATH |
protected java.lang.String |
runtimeId
SLING-2901: the runtimeId is a unique id, set on activation, used for robust duplicate sling.id detection
|
protected java.lang.String |
slingId
the sling id of the local instance
|
Constructor and Description |
---|
BaseViewChecker() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context) |
protected void |
bindHttpService(org.osgi.framework.ServiceReference reference)
Bind a http service
|
void |
checkView()
for testing only
|
protected void |
deactivate() |
protected void |
doActivate() |
protected void |
doCheckView()
Check whether the established view matches the reality, ie matches the
heartbeats
|
protected abstract AnnouncementRegistry |
getAnnouncementRegistry() |
protected abstract BaseConfig |
getConnectorConfig() |
protected abstract ConnectorRegistry |
getConnectorRegistry() |
protected java.lang.String |
getEndpointsAsString() |
protected abstract ResourceResolverFactory |
getResourceResolverFactory() |
protected abstract Scheduler |
getScheduler() |
protected abstract SlingSettingsService |
getSlingSettingsService() |
void |
heartbeatAndCheckView()
Issue a heartbeat and check the view
|
protected void |
issueConnectorPings()
Issue a remote heartbeat using the topology connectors
|
protected void |
issueHeartbeat()
Issue a heartbeat.
|
void |
run() |
void |
triggerAsyncConnectorPing()
Trigger the issuance of the next heartbeat asap instead of at next heartbeat interval
|
protected void |
unbindHttpService(org.osgi.framework.ServiceReference reference)
Unbind a http service
|
protected abstract void |
updateProperties() |
protected final org.slf4j.Logger logger
protected static final java.lang.String PROPERTY_ID_ENDPOINTS
protected static final java.lang.String PROPERTY_ID_SLING_HOME_PATH
protected static final java.lang.String PROPERTY_ID_RUNTIME
protected java.lang.String NAME
protected java.lang.String slingId
protected java.lang.String runtimeId
protected final java.lang.Object lock
protected volatile boolean activated
protected org.osgi.service.component.ComponentContext context
protected final java.util.Map<java.lang.Long,java.lang.String[]> endpoints
protected PeriodicBackgroundJob periodicPingJob
protected abstract SlingSettingsService getSlingSettingsService()
protected abstract ResourceResolverFactory getResourceResolverFactory()
protected abstract ConnectorRegistry getConnectorRegistry()
protected abstract AnnouncementRegistry getAnnouncementRegistry()
protected abstract Scheduler getScheduler()
protected abstract BaseConfig getConnectorConfig()
@Activate protected void activate(org.osgi.service.component.ComponentContext context)
protected void doActivate()
@Deactivate protected void deactivate()
public void checkView()
checkView
in interface ViewChecker
public void run()
run
in interface java.lang.Runnable
public void heartbeatAndCheckView()
ViewChecker
heartbeatAndCheckView
in interface ViewChecker
public void triggerAsyncConnectorPing()
protected void issueHeartbeat()
This action consists of first updating the local properties, then issuing a cluster-local heartbeat (within the repository) and then a remote heartbeat (to all the topology connectors which announce this part of the topology to others)
protected abstract void updateProperties()
protected void issueConnectorPings()
protected void doCheckView()
protected void bindHttpService(org.osgi.framework.ServiceReference reference)
protected void unbindHttpService(org.osgi.framework.ServiceReference reference)
protected java.lang.String getEndpointsAsString()
Copyright © 2022 The Apache Software Foundation. All rights reserved.