public static void main(String[] args) throws Exception { HazelcastInstance[] instances = new HazelcastInstance[3]; instances[0] = Hazelcast.newHazelcastInstance(); instances[1] = Hazelcast.newHazelcastInstance(); instances[2] = Hazelcast.newHazelcastInstance(); String key = generateKeyOwnedBy(instances[1]); IScheduledExecutorService scheduler = instances[0].getScheduledExecutorService("scheduler"); IScheduledFuture<String> future = scheduler.scheduleOnKeyOwner(new EchoTask("My Task"), key, 5, TimeUnit.SECONDS); instances[1].getLifecycleService().terminate(); Object result = future.get(); System.out.println("Result: " + result); future.dispose(); Hazelcast.shutdownAll(); } }