public interface LockManager
限定符和类型 | 方法和说明 |
---|---|
boolean |
check(long userId,
long resourceId)
判断指定人员是否可以访问资源。
|
boolean |
check(long userId,
long resourceId,
int action)
判断指定人员是否可以访问资源。
|
Lock |
createDefaultLock(long owner,
long resourceId,
int action,
String from,
String param0,
String param1,
boolean useNowexpirationTime) |
List<Lock> |
getAllLock() |
Lock |
getLock(long resourceId,
int action)
取得资源的指定操作的锁。
|
List<Lock> |
getLocks(long resourceId)
取得资源的所有锁。
|
String |
getModule()
取得当前锁管理器所属模块。
|
String |
getOwnerName(Lock lock)
取得加锁人信息。
|
LockState |
isValid(Lock lock)
判断锁是否有效。
|
boolean |
lock(Lock lock)
对资源的操作加锁(高级使用,谨慎,lock参数需使用lockManager.createDefaultLock创建此对象才行)。
|
boolean |
lock(long owner,
long resourceId)
加锁。
|
boolean |
lock(long owner,
long resourceId,
int action)
对资源的操作加锁。
|
boolean |
lock(long owner,
long resourceId,
int action,
String from) |
boolean |
lock(long owner,
long resourceId,
int action,
String from,
boolean useNowexpirationTime) |
boolean |
lock(long owner,
long resourceId,
String from) |
void |
unlock(long resourceId)
解锁。
|
void |
unlock(long resourceId,
int action)
解锁。
|
void |
unlock(long owner,
long resourceId,
int action)
解锁。
|
void |
updateLockExpirationTime(long rd,
int action,
long time) |
boolean lock(long owner, long resourceId)
owner
- 加锁人Id。resourceId
- 资源Id,如协同的affairIdtrue
,如果指定资源锁已存在返回false
。boolean lock(long owner, long resourceId, int action)
owner
- 加锁人Id。resourceId
- 资源Id。action
- 资源操作。true
,如果指定资源操作锁已存在返回false
。boolean lock(long owner, long resourceId, int action, String from)
owner
- resourceId
- action
- from
- 来自哪个端,目前只有WXT用到,WXT表示微协同boolean lock(long owner, long resourceId, int action, String from, boolean useNowexpirationTime)
owner
- resourceId
- action
- from
- 来自哪个端,目前只有WXT用到,WXT表示微协同boolean lock(long owner, long resourceId, String from)
owner
- resourceId
- from
- 来自哪个端,目前只有WXT用到,WXT表示微协同boolean lock(Lock lock)
lock
- Lock createDefaultLock(long owner, long resourceId, int action, String from, String param0, String param1, boolean useNowexpirationTime)
List<Lock> getLocks(long resourceId)
resourceId
- 资源IdLock getLock(long resourceId, int action)
resourceId
- 资源Id。action
- 操作。null
。void unlock(long resourceId)
resourceId
- 资源Id。void unlock(long resourceId, int action)
resourceId
- 资源Id。action
- 资源操作。void unlock(long owner, long resourceId, int action)
owner
- 加锁人IdresourceId
- 资源Id。action
- 资源操作。boolean check(long userId, long resourceId)
userId
- 人员IdresourceId
- 资源Id。true
,否则返回false
。boolean check(long userId, long resourceId, int action)
userId
- resourceId
- action
- String getModule()
LockState isValid(Lock lock)
true
,否则返回false
void updateLockExpirationTime(long rd, int action, long time)
Copyright © 2016–2017. All rights reserved.