13 Kasım 2022 Pazar

HazelcastAPI Cluster Arayüzü

Giriş
Şu satırı dahil ederiz
import com.hazelcast.cluster.Cluster;
constructor
Örnek
Şöyle yaparız
HazelcastInstance instance = ..;
Cluster cluster = instance.getCluster();
addMembershipListener metodu
Örnek
Şöyle yaparız
import com.hazelcast.cluster.MembershipEvent;
import com.hazelcast.cluster.MembershipListener;
import com.hazelcast.cluster.Cluster;

public class ApplicationMembershipListener implements MembershipListener {

  @Override
  public void memberAdded(MembershipEvent membershipEvent) {
    logger.info("New member added to cluster {} ",membershipEvent);

  }

  @Override
  public void memberRemoved(MembershipEvent membershipEvent) {
    logger.info("A member removed from cluster {} ",membershipEvent);
  }
}

HazelcastInstance hazelcastInstance = ...;
Cluster cluster = hazelcastInstance.getCluster();

ApplicationMembershipListener membershipListener = new ApplicationMembershipListener();
cluster.addMembershipListener(membershipListener);
getLocalMember metodu
Şöyle yaparız. Kendi Member nesnemi döner
HazelcastInstance hazelcastInstance = ...
Member localMember = hazelcastInstance.getCluster().getLocalMember();
getMembers metodu
İmzası şöyle. Member seti döner
Set<Member> getMembers();





Hiç yorum yok:

Yorum Gönder

THIRD-PARTY.txt Dosyası

Kullanılan harici kütüphanelerin sürümleri bu dosyada Dosyanın yolu şöyle hazelcast/licenses/THIRD-PARTY.txt