@Service(value=VotingHandler.class) public class VotingHandler extends Object implements org.osgi.service.event.EventHandler
Modifier and Type | Class and Description |
---|---|
static class |
VotingHandler.VotingDetail |
Modifier and Type | Field and Description |
---|---|
protected String |
NAME
the name used for the period job with the scheduler
|
Constructor and Description |
---|
VotingHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context) |
Map<VotingView,VotingHandler.VotingDetail> |
analyzeVotings(org.apache.sling.api.resource.ResourceResolver resourceResolver)
Analyze any ongoing voting in the repository.
|
void |
cleanupTimedoutVotings(org.apache.sling.api.resource.ResourceResolver resourceResolver) |
protected void |
deactivate() |
void |
handleEvent(org.osgi.service.event.Event event)
handle repository changes and react to ongoing votings
|
void |
setLeaderElectionId(String leaderElectionId) |
static VotingHandler |
testConstructor(org.apache.sling.settings.SlingSettingsService settingsService,
org.apache.sling.api.resource.ResourceResolverFactory factory,
Config config)
for testing only
|
protected String NAME
public static VotingHandler testConstructor(org.apache.sling.settings.SlingSettingsService settingsService, org.apache.sling.api.resource.ResourceResolverFactory factory, Config config)
@Deactivate protected void deactivate()
@Activate protected void activate(org.osgi.service.component.ComponentContext context)
public void handleEvent(org.osgi.service.event.Event event)
handleEvent
in interface org.osgi.service.event.EventHandler
public Map<VotingView,VotingHandler.VotingDetail> analyzeVotings(org.apache.sling.api.resource.ResourceResolver resourceResolver) throws org.apache.sling.api.resource.PersistenceException
SLING-2885: this method must be synchronized as it can be called concurrently by the HearbeatHandler.doCheckView and the VotingHandler.handleEvent.
org.apache.sling.api.resource.PersistenceException
public void cleanupTimedoutVotings(org.apache.sling.api.resource.ResourceResolver resourceResolver)
public void setLeaderElectionId(String leaderElectionId)
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.