com.hazelcast.core
Interface Cluster


public interface Cluster

Hazelcast cluster interface.


Method Summary
 void addMembershipListener(MembershipListener listener)
          Adds MembershipListener to listen for membership updates.
 long getClusterTime()
          Returns the cluster-wide time.
 Member getLocalMember()
          Returns this Hazelcast instance member
 Set<Member> getMembers()
          Set of current members of the cluster.
 void removeMembershipListener(MembershipListener listener)
          Removes the specified membership listener.
 

Method Detail

addMembershipListener

void addMembershipListener(MembershipListener listener)
Adds MembershipListener to listen for membership updates.

Parameters:
listener - membership listener

removeMembershipListener

void removeMembershipListener(MembershipListener listener)
Removes the specified membership listener.

Parameters:
listener - membership listener to remove

getMembers

Set<Member> getMembers()
Set of current members of the cluster. Returning set instance is not modifiable. Every member in the cluster has the same member list in the same order. First member is the oldest member.

Returns:
current members of the cluster

getLocalMember

Member getLocalMember()
Returns this Hazelcast instance member

Returns:
this Hazelcast instance member

getClusterTime

long getClusterTime()
Returns the cluster-wide time.

Cluster tries to keep a cluster-wide time which is might be different than the member's own system time. Cluster-wide time is -almost- the same on all members of the cluster.

Returns:


Copyright © 2008-2012 Hazel Ltd. All Rights Reserved.