@Test public void testDistributedLock() throws InterruptedException { DistributedLock lock = new DistributedLock("bingo_distributed_lock"); assertTrue(lock.acquire(10)); assertFalse(lock.acquire(10)); TimeUnit.SECONDS.sleep(10); assertTrue(lock.acquire()); assertTrue(lock.release()); assertTrue(lock.acquire()); }
public DistributedLock(String key) { this.key = key; }
DistributedLock { public DistributedLock(String key) { this.key = key; } }
DistributedLock { public DistributedLock(String key) { this.key = key; } DistributedLock(String key); }
DistributedLock { public DistributedLock(String key) { this.key = key; } DistributedLock(String key); boolean acquire(int timeout); boolean acquire(); boolean release(); }
DistributedLock { public DistributedLock(String key) { this.key = key; } DistributedLock(String key); boolean acquire(int timeout); boolean acquire(); boolean release();  }