private void waitForAllClientShutdown(ClientService clientService) throws InterruptedException { Lock lock = new ReentrantLock(); Condition notEmpty = lock.newCondition(); clientService.addClientListener(new ClientShutdownListener(lock, notEmpty)); lock.lock(); try { while(clientService.getConnectedClients().size() > 0) { notEmpty.await(DEFAULT_WAIT_UNIT, TimeUnit.MINUTES); } } finally { lock.unlock(); } LOGGER.info("All slave nodes finished, shutting down"); }
@Override public ClientService getClientService() { return null; }
@Override public ClientService getClientService() { return getHazelcastInstance().getClientService(); }