Package com.hazelcast.core

Examples of com.hazelcast.core.ILock.unlock()


                                    rcs.remove(uri);
                                }
                            }
                        }
                    } finally {
                        lock.unlock();
                    }
                }
            }
        } catch (Exception e) {
            if (e.getCause() != null && e.getCause().getCause() != null) {
View Full Code Here


                            for (Object k : keys) {
                                endpointMap.remove(k);
                            }
                        }
                    } finally {
                        lock.unlock();
                    }
                }
            }
        } catch (Exception e) {
            if (e.getCause() != null && e.getCause().getCause() != null) {
View Full Code Here

                                    rcs.remove(uri);
                                }
                            }
                        }
                    } finally {
                        lock.unlock();
                    }
                }
            }
        } catch (Exception e) {
            if (e.getCause() != null && e.getCause().getCause() != null) {
View Full Code Here

    @Override
    public void run()
    {
      logger.info(threadName+"   ---   Acquiring lock ...");
      ILock lock = Hazelcast.getLock(lockName);
      lock.unlock();
      lock.lock();
      lock.lock();
      logger.info(threadName+"   ---   Acquired lock.");
      logger.info(threadName+"   ---   Waiting: "+waitTime);
      try
View Full Code Here

        Logger.getLogger(TestHazelcastLocks.class.getName()).log(Level.SEVERE, null, ex);
      }
      logger.info(threadName+"   ---   Wait done.");
      logger.info(threadName+"   ---   Releasing lock ...");
      ILock lock2 = Hazelcast.getLock(lockName);
      lock2.unlock();
      lock.unlock();
      logger.info(threadName+"   ---   Unlocked");
    }

  }
View Full Code Here

                            for (Object k : keys) {
                                endpointMap.remove(k);
                            }
                        }
                    } finally {
                        lock.unlock();
                    }
                }
            }
        } catch (Exception e) {
            if (e.getCause() != null && e.getCause().getCause() != null) {
View Full Code Here

                            for (Object k : keys) {
                                endpointMap.remove(k);
                            }
                        }
                    } finally {
                        lock.unlock();
                    }
                }
            }
        } catch (Exception e) {
            if (e.getCause() != null && e.getCause().getCause() != null) {
View Full Code Here

        new Thread() {
            public void run() {
                lock.lock();
                latch0.countDown();
                sleepMillis(500);
                lock.unlock();
            }
        }.start();

        latch0.await();
View Full Code Here

        Thread thread1 = new Thread(tryLockRunnable);
        thread1.start();
        thread1.join();
        assertEquals(0, atomicInteger.get());

        lock.unlock();
        Thread thread2 = new Thread(tryLockRunnable);
        thread2.start();
        thread2.join();

        assertEquals(1, atomicInteger.get());
View Full Code Here

        assertFalse(lock.isLocked());

        lock.lock();
        assertTrue(lock.isLocked());
        lock.unlock();

        assertFalse(lock.isLocked());
    }

    @Test(timeout = 60000)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.