public class LeaderInitiator extends Object implements org.springframework.context.Lifecycle, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
candidates
with Hazelcast. Upon construction, start()
must be invoked to
register the candidate for leadership election.Constructor and Description |
---|
LeaderInitiator(com.hazelcast.core.HazelcastInstance client,
Candidate candidate)
Construct a
LeaderInitiator . |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
boolean |
isRunning() |
void |
setLeaderEventPublisher(LeaderEventPublisher leaderEventPublisher)
Sets the
LeaderEventPublisher . |
void |
start()
Start the registration of the
candidate for leader election. |
void |
stop()
Stop the registration of the
candidate for leader election. |
public LeaderInitiator(com.hazelcast.core.HazelcastInstance client, Candidate candidate)
LeaderInitiator
.client
- Hazelcast clientcandidate
- leadership election candidatepublic void start()
candidate
for leader election.start
in interface org.springframework.context.Lifecycle
public void stop()
candidate
for leader election.
If the candidate is currently leader, its leadership will be revoked.stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
candidate
is runningpublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
public void setLeaderEventPublisher(LeaderEventPublisher leaderEventPublisher)
LeaderEventPublisher
.leaderEventPublisher
- the event publisherCopyright © 2016 Pivotal Software, Inc.. All rights reserved.