org.usergrid.locking.singlenode
Class SingleNodeLockImpl
java.lang.Object
org.usergrid.locking.singlenode.SingleNodeLockImpl
- All Implemented Interfaces:
- Lock
public class SingleNodeLockImpl
- extends Object
- implements Lock
- 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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingleNodeLockImpl
public SingleNodeLockImpl(ReentrantLock lock)
tryLock
public boolean tryLock(long timeout,
TimeUnit time)
throws UGLockException
- Description copied from interface:
Lock
- Acquire the lock. Wait the specified amount of time before giving up
- Specified by:
tryLock
in interface Lock
- Parameters:
timeout
- The amount of time to waittime
- the units of time to wait
- Throws:
UGLockException
lock
public void lock()
throws UGLockException
- Description copied from interface:
Lock
- Block until a lock is available
- Specified by:
lock
in interface Lock
- Throws:
UGLockException
unlock
public void unlock()
throws UGLockException
- Description copied from interface:
Lock
- Release the lock
- Specified by:
unlock
in interface Lock
- Throws:
UGLockException
Copyright © 2013. All Rights Reserved.