Class IdentitySharedExclusiveLock.IdentityLock

java.lang.Object
org.wildfly.security.auth.realm.IdentitySharedExclusiveLock.IdentityLock
All Implemented Interfaces:
AutoCloseable
Enclosing class:
IdentitySharedExclusiveLock

public class IdentitySharedExclusiveLock.IdentityLock extends Object implements AutoCloseable
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 - true if this lock is exclusive, false if 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:
      close in interface AutoCloseable
    • isExclusive

      public boolean isExclusive()
      Determine whether this lock is exclusive or shared.
      Returns:
      true if this lock is exclusive, false if 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 via release() or close().
      Returns:
      true if this lock is valid, false otherwise