com.hazelcast.cluster
Class ClusterServiceImpl
java.lang.Object
com.hazelcast.cluster.ClusterServiceImpl
- All Implemented Interfaces:
- ClusterService, com.hazelcast.nio.ConnectionListener, CoreService, EventPublishingService<MembershipEvent,MembershipListener>, ManagedService
public final class ClusterServiceImpl
- extends Object
- implements ClusterService, com.hazelcast.nio.ConnectionListener, ManagedService, EventPublishingService<MembershipEvent,MembershipListener>
Method Summary |
String |
addMembershipListener(MembershipListener listener)
|
JoinRequest |
checkJoinInfo(com.hazelcast.nio.Address target)
|
void |
connectionAdded(com.hazelcast.nio.Connection connection)
|
void |
connectionRemoved(com.hazelcast.nio.Connection connection)
|
protected com.hazelcast.instance.MemberImpl |
createMember(com.hazelcast.nio.Address address,
String nodeUuid,
String ipV6ScopeId,
Map<String,Object> attributes)
|
void |
dispatchEvent(MembershipEvent event,
MembershipListener listener)
|
Cluster |
getClusterProxy()
|
long |
getClusterTime()
|
long |
getClusterTimeFor(long localTime)
|
Member |
getLocalMember()
|
com.hazelcast.nio.Address |
getMasterAddress()
|
com.hazelcast.instance.MemberImpl |
getMember(com.hazelcast.nio.Address address)
|
com.hazelcast.instance.MemberImpl |
getMember(String uuid)
|
Collection<com.hazelcast.instance.MemberImpl> |
getMemberList()
|
Set<Member> |
getMembers()
|
com.hazelcast.spi.impl.NodeEngineImpl |
getNodeEngine()
|
int |
getSize()
|
com.hazelcast.nio.Address |
getThisAddress()
|
void |
heartBeater()
|
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes the ManagedService |
boolean |
isJoinInProgress()
|
boolean |
isMaster()
|
String |
membersString()
|
void |
removeAddress(com.hazelcast.nio.Address deadAddress)
|
boolean |
removeMembershipListener(String registrationId)
|
void |
reset()
reset service, back to initial state |
boolean |
sendJoinRequest(com.hazelcast.nio.Address toAddress,
boolean withCredentials)
|
void |
sendShutdownMessage()
|
void |
setMasterTime(long masterTime)
|
void |
shutdown(boolean terminate)
Shuts down the ManagedService. |
String |
toString()
|
void |
updateMemberAttribute(String uuid,
MemberAttributeOperationType operationType,
String key,
Object value)
|
boolean |
validateJoinMessage(JoinMessage joinMessage)
|
SERVICE_NAME
public static final String SERVICE_NAME
- See Also:
- Constant Field Values
thisAddress
protected final com.hazelcast.nio.Address thisAddress
thisMember
protected final com.hazelcast.instance.MemberImpl thisMember
ClusterServiceImpl
public ClusterServiceImpl(com.hazelcast.instance.Node node)
init
public void init(NodeEngine nodeEngine,
Properties properties)
- Description copied from interface:
ManagedService
- Initializes the ManagedService
- Specified by:
init
in interface ManagedService
- Parameters:
nodeEngine
- the NodeEngine this ManagedService is initialized with.properties
- the Properties
isJoinInProgress
public boolean isJoinInProgress()
checkJoinInfo
public JoinRequest checkJoinInfo(com.hazelcast.nio.Address target)
validateJoinMessage
public boolean validateJoinMessage(JoinMessage joinMessage)
throws Exception
- Throws:
Exception
heartBeater
public final void heartBeater()
removeAddress
public void removeAddress(com.hazelcast.nio.Address deadAddress)
reset
public void reset()
- Description copied from interface:
ManagedService
- reset service, back to initial state
- Specified by:
reset
in interface ManagedService
updateMemberAttribute
public void updateMemberAttribute(String uuid,
MemberAttributeOperationType operationType,
String key,
Object value)
sendJoinRequest
public boolean sendJoinRequest(com.hazelcast.nio.Address toAddress,
boolean withCredentials)
connectionAdded
public void connectionAdded(com.hazelcast.nio.Connection connection)
- Specified by:
connectionAdded
in interface com.hazelcast.nio.ConnectionListener
connectionRemoved
public void connectionRemoved(com.hazelcast.nio.Connection connection)
- Specified by:
connectionRemoved
in interface com.hazelcast.nio.ConnectionListener
getNodeEngine
public com.hazelcast.spi.impl.NodeEngineImpl getNodeEngine()
sendShutdownMessage
public void sendShutdownMessage()
createMember
protected com.hazelcast.instance.MemberImpl createMember(com.hazelcast.nio.Address address,
String nodeUuid,
String ipV6ScopeId,
Map<String,Object> attributes)
getMember
public com.hazelcast.instance.MemberImpl getMember(com.hazelcast.nio.Address address)
- Specified by:
getMember
in interface ClusterService
getMember
public com.hazelcast.instance.MemberImpl getMember(String uuid)
- Specified by:
getMember
in interface ClusterService
getMemberList
public Collection<com.hazelcast.instance.MemberImpl> getMemberList()
- Specified by:
getMemberList
in interface ClusterService
getMembers
public Set<Member> getMembers()
- Specified by:
getMembers
in interface ClusterService
shutdown
public void shutdown(boolean terminate)
- Description copied from interface:
ManagedService
- Shuts down the ManagedService.
- Specified by:
shutdown
in interface ManagedService
getMasterAddress
public com.hazelcast.nio.Address getMasterAddress()
- Specified by:
getMasterAddress
in interface ClusterService
isMaster
public boolean isMaster()
- Specified by:
isMaster
in interface ClusterService
getThisAddress
public com.hazelcast.nio.Address getThisAddress()
- Specified by:
getThisAddress
in interface ClusterService
getLocalMember
public Member getLocalMember()
getSize
public int getSize()
- Specified by:
getSize
in interface ClusterService
getClusterTime
public long getClusterTime()
- Specified by:
getClusterTime
in interface ClusterService
setMasterTime
public void setMasterTime(long masterTime)
getClusterTimeFor
public long getClusterTimeFor(long localTime)
addMembershipListener
public String addMembershipListener(MembershipListener listener)
removeMembershipListener
public boolean removeMembershipListener(String registrationId)
dispatchEvent
public void dispatchEvent(MembershipEvent event,
MembershipListener listener)
- Specified by:
dispatchEvent
in interface EventPublishingService<MembershipEvent,MembershipListener>
getClusterProxy
public Cluster getClusterProxy()
membersString
public String membersString()
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.