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