public abstract class BaseViewChecker extends Object implements ViewChecker, 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 Map<Long,String[]> |
endpoints
SLING-4765 : store endpoints to /clusterInstances for more verbose duplicate slingId/ghost detection
|
protected Object |
lock
lock object for synchronizing the run method
|
protected org.slf4j.Logger |
logger |
protected String |
NAME
the name used for the period job with the scheduler
|
protected PeriodicBackgroundJob |
periodicPingJob |
protected static String |
PROPERTY_ID_ENDPOINTS |
protected static String |
PROPERTY_ID_RUNTIME |
protected static String |
PROPERTY_ID_SLING_HOME_PATH |
protected String |
runtimeId
SLING-2901: the runtimeId is a unique id, set on activation, used for robust duplicate sling.id detection
|
protected 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 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 String PROPERTY_ID_ENDPOINTS
protected static final String PROPERTY_ID_SLING_HOME_PATH
protected static final String PROPERTY_ID_RUNTIME
protected String NAME
protected String slingId
protected String runtimeId
protected final Object lock
protected volatile boolean activated
protected org.osgi.service.component.ComponentContext context
protected final Map<Long,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 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 String getEndpointsAsString()
Copyright © 2017 The Apache Software Foundation. All rights reserved.