org.usergrid.locking
Interface Lock

All Known Implementing Classes:
HectorLockImpl, NoOpLockImpl, SingleNodeLockImpl, ZookeeperLockImpl

public interface Lock

The lock object to acquire

Author:
tnine

Method Summary
 void lock()
          Block until a lock is available
 boolean tryLock(long timeout, TimeUnit time)
          Acquire the lock.
 void unlock()
          Release the lock
 

Method Detail

tryLock

boolean tryLock(long timeout,
                TimeUnit time)
                throws UGLockException
Acquire the lock. Wait the specified amount of time before giving up

Parameters:
timeout - The amount of time to wait
time - the units of time to wait
Throws:
UGLockException

lock

void lock()
          throws UGLockException
Block until a lock is available

Throws:
UGLockException

unlock

void unlock()
            throws UGLockException
Release the lock

Throws:
UGLockException


Copyright © 2013. All Rights Reserved.