Giriş
Şu satırı dahil ederiz
import com.hazelcast.client.impl.connection.tcp.TcpClientConnectionManager;
Bu sınıfın alanlarından birisi şöyle. TcpClientConnection nesnelerini saklar
private final ConcurrentMap<UUID, TcpClientConnection> activeConnections = new ConcurrentHashMap<>();
Bir diğer alana ise şöyle. Cluster üyelerini bulduktan sonra bunlara bağlanmaya çalışır
private final ClusterDiscoveryService clusterDiscoveryService;
doConnectToCluster metodu
Metodun için şöyle. Keşfedilen cluster üzerinde dolaşır
private void doConnectToCluster() {
CandidateClusterContext currentContext = clusterDiscoveryService.current();
logger.info("Trying to connect to cluster: " + currentContext.getClusterName());
// try the current cluster
if (doConnectToCandidateCluster(currentContext, false)) {
connectionProcessListenerRunner
.onClusterConnectionSucceeded(currentContext.getClusterName());
return;
}
...
}
Hiç yorum yok:
Yorum Gönder