Ejemplo n.º 1
0
 private IHazelcastClient getHazelcastClient() {
   IHazelcastClient hazelcastClient =
       hazelcastClientFactory.getHazelcastClient(
           hazelcastServers, hazelcastUsername, hazelcastPassword, poolConfig);
   if (hazelcastClient != null) {
     allocatedHazelcastClients.add(hazelcastClient);
   }
   return hazelcastClient;
 }
Ejemplo n.º 2
0
 private void returnHazelcastClient(IHazelcastClient hazelcastClient) {
   if (hazelcastClient != null) {
     try {
       allocatedHazelcastClients.remove(hazelcastClient);
     } finally {
       hazelcastClientFactory.returnHazelcastClient(hazelcastClient);
     }
   }
 }
Ejemplo n.º 3
0
 public void destroy() {
   for (IHazelcastClient hazelcastClient : allocatedHazelcastClients) {
     try {
       hazelcastClientFactory.returnHazelcastClient(hazelcastClient);
     } catch (Exception e) {
     }
   }
   allocatedHazelcastClients.clear();
 }