public class QuorumServiceImpl extends Object implements EventPublishingService<QuorumEvent,QuorumListener>, MembershipAwareService, QuorumService
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_NAME |
Constructor and Description |
---|
QuorumServiceImpl(NodeEngineImpl nodeEngine) |
Modifier and Type | Method and Description |
---|---|
void |
addQuorumListener(String name,
QuorumListener listener) |
void |
dispatchEvent(QuorumEvent event,
QuorumListener listener)
Notifies the service of a published event.
|
void |
ensureQuorumPresent(Operation op)
Ensures that the quorum for the given operation is present.
|
Quorum |
getQuorum(String quorumName)
Returns the
Quorum instance for a given quorum name. |
void |
memberAdded(MembershipServiceEvent event)
Invoked when a new member is added to the cluster.
|
void |
memberAttributeChanged(MemberAttributeServiceEvent event)
Invoked when a member attribute is changed.
|
void |
memberRemoved(MembershipServiceEvent event)
Invoked when an existing member leaves the cluster.
|
void |
start() |
public static final String SERVICE_NAME
public QuorumServiceImpl(NodeEngineImpl nodeEngine)
public void start()
public void addQuorumListener(String name, QuorumListener listener)
public void ensureQuorumPresent(Operation op)
QuorumAwareService
.op
- the operation for which the quorum should be presentQuorumException
- if the operation requires a quorum and the quorum is not presentpublic void dispatchEvent(QuorumEvent event, QuorumListener listener)
EventPublishingService
dispatchEvent
in interface EventPublishingService<QuorumEvent,QuorumListener>
event
- the published eventlistener
- the listener registered for this eventpublic void memberAdded(MembershipServiceEvent event)
MembershipAwareService
memberAdded
in interface MembershipAwareService
event
- the event for a new member added to the clusterpublic void memberRemoved(MembershipServiceEvent event)
MembershipAwareService
memberRemoved
in interface MembershipAwareService
event
- the event for an existing member leaving the clusterpublic void memberAttributeChanged(MemberAttributeServiceEvent event)
MembershipAwareService
memberAttributeChanged
in interface MembershipAwareService
event
- the event for a member attribute being changedpublic Quorum getQuorum(String quorumName)
QuorumService
Quorum
instance for a given quorum name.getQuorum
in interface QuorumService
quorumName
- name of the quorumQuorum
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.