org.apache.sling.discovery.impl.common.heartbeat
Class HeartbeatHandler

java.lang.Object
  extended by org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler
All Implemented Interfaces:
Runnable, org.apache.sling.launchpad.api.StartupListener

@Service(value={HeartbeatHandler.class,org.apache.sling.launchpad.api.StartupListener.class})
public class HeartbeatHandler
extends Object
implements Runnable, org.apache.sling.launchpad.api.StartupListener

The heartbeat handler is responsible and capable of issuing both local and remote heartbeats and registers a periodic job with the scheduler for doing so.

Local heartbeats are stored in the repository. Remote heartbeats are POSTs to remote TopologyConnectorServlets.


Constructor Summary
HeartbeatHandler()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext context)
           
protected  void deactivate()
           
 void inform(org.apache.sling.launchpad.api.StartupMode mode, boolean finished)
           
 void initialize(DiscoveryServiceImpl discoveryService, String initialVotingId)
          The initialize method is called by the DiscoveryServiceImpl.activate as we require the discoveryService (and the discoveryService has a reference on us - but we cant have circular references in osgi).
 void run()
           
 void startupFinished(org.apache.sling.launchpad.api.StartupMode mode)
           
 void startupProgress(float ratio)
           
 void triggerHeartbeat()
          Trigger the issuance of the next heartbeat asap instead of at next heartbeat interval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeartbeatHandler

public HeartbeatHandler()
Method Detail

inform

public void inform(org.apache.sling.launchpad.api.StartupMode mode,
                   boolean finished)
Specified by:
inform in interface org.apache.sling.launchpad.api.StartupListener

startupFinished

public void startupFinished(org.apache.sling.launchpad.api.StartupMode mode)
Specified by:
startupFinished in interface org.apache.sling.launchpad.api.StartupListener

startupProgress

public void startupProgress(float ratio)
Specified by:
startupProgress in interface org.apache.sling.launchpad.api.StartupListener

activate

@Activate
protected void activate(org.osgi.service.component.ComponentContext context)

deactivate

@Deactivate
protected void deactivate()

initialize

public void initialize(DiscoveryServiceImpl discoveryService,
                       String initialVotingId)
The initialize method is called by the DiscoveryServiceImpl.activate as we require the discoveryService (and the discoveryService has a reference on us - but we cant have circular references in osgi).

The initialVotingId is used to avoid an unnecessary topologyChanged event when switching form isolated to established view but with only the local instance in the view.


run

public void run()
Specified by:
run in interface Runnable

triggerHeartbeat

public void triggerHeartbeat()
Trigger the issuance of the next heartbeat asap instead of at next heartbeat interval



Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.