Example #1
0
 @Test
 public void testHazelcast() {
   Lock lock = Hazelcast.getLock("hasNext-4fe5683403642e0674728d09-na");
   System.out.println("TRY TO GET LOCK");
   lock.lock();
   try {
     System.out.println("GOT LOCK");
     Thread.sleep(1000);
   } catch (InterruptedException e) {
     e.printStackTrace();
   } finally {
     System.out.println("UNLOCKED LOCK");
     lock.unlock();
   }
 }