public interface DistributedLock extends RemoteObject
| Modifier and Type | Method and Description |
|---|---|
long |
lock()
一直等直到获得锁为止
|
long |
tryLock(long time,
TimeUnit unit)
在time*unit时间内尝试lock
|
void |
unlock(long token) |
long lock() throws RemoteException, TimeoutException
RemoteExceptionTimeoutExceptionlong tryLock(long time,
TimeUnit unit)
throws RemoteException,
TimeoutException
time - unit - RemoteExceptionTimeoutExceptionvoid unlock(long token)
throws RemoteException
RemoteExceptionCopyright © 2006–2018 TinyGroup. All rights reserved.