Giriş
Şu satırı dahil ederiz
import com.hazelcast.client.HazelcastClient;
newHazelcastClient metodu
Örnek
Şöyle yaparız
import com.hazelcast.client.HazelcastClient; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.map.IMap; HazelcastInstance hzInstance = null;
try { hzInstance = HazelcastClient.newHazelcastClient();
IMap<Long, String> testMap = hzInstance.getMap("testMap");
System.out.println(testMap.get(1L)); } finally { hzClient.shutdown(); }
newHazelcastClient metodu - ClientConfig
ClientConfig nesnesi verilir.
shutdown metodu - HazelcastInstance
Açıklaması şöyle
... a client also is a hazelcastinstance and can be shutdown using the shutdown method.
Hiç yorum yok:
Yorum Gönder