Interface LockingService
public interface LockingService
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisLockOwner(Object entityId, Principal principal) Return true if the given principal holds the lock for the given entity.booleanLocks the given entity for the given principal.Returns the lock owner, or null if not lockedbooleanUnlocks the given entity for the current principal.
-
Method Details
-
lock
Locks the given entity for the given principal. If no lock exists for the given entity then the lock will be obtained.- Parameters:
entityId- the entity to lockprincipal- the lock owner- Returns:
- true if lock succeeds, otherwise false
-
unlock
Unlocks the given entity for the current principal. If the current principal holds the lock it will be released.- Parameters:
entityId- the entity to unlockprincipal- the lock owner- Returns:
- true if unlock succeeds, otherwise false
-
isLockOwner
Return true if the given principal holds the lock for the given entity.- Parameters:
entityId- the entity with the lockprincipal- the principal- Returns:
- true if the given principal holds the lock for the given entity
-
lockOwner
Returns the lock owner, or null if not locked- Parameters:
entityId- the entity with the lock- Returns:
- lock owner
-