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
RemoteException
TimeoutException
long tryLock(long time, TimeUnit unit) throws RemoteException, TimeoutException
time
- unit
- RemoteException
TimeoutException
void unlock(long token) throws RemoteException
RemoteException
Copyright © 2006–2018 TinyGroup. All rights reserved.