Package org.wildfly.security.auth.realm
Class IdentitySharedExclusiveLock.IdentityLock
java.lang.Object
org.wildfly.security.auth.realm.IdentitySharedExclusiveLock.IdentityLock
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- IdentitySharedExclusiveLock
Class that represents a lock on a realm identity. A lock object is created each time a lock is
acquired on a realm identity via
IdentitySharedExclusiveLock.lockExclusive() or
IdentitySharedExclusiveLock.lockShared().-
Constructor Details
-
IdentityLock
public IdentityLock(boolean exclusive) Construct a new instance.- Parameters:
exclusive-trueif this lock is exclusive,falseif this lock is shared
-
-
Method Details
-
release
public void release()Release this lock. Invoking this method has no effect if this lock is invalid. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
isExclusive
public boolean isExclusive()Determine whether this lock is exclusive or shared.- Returns:
trueif this lock is exclusive,falseif this lock is shared
-
isValid
public boolean isValid()Determine whether this lock is valid. A lock starts out valid and becomes invalid when it is released viarelease()orclose().- Returns:
trueif this lock is valid,falseotherwise
-