Class RWOLockManager.LockState<OBJECT,​CONTEXT>

  • Enclosing class:
    RWOLockManager<OBJECT,​CONTEXT>

    public static class RWOLockManager.LockState<OBJECT,​CONTEXT>
    extends java.lang.Object
    Represents a combination of locks for one OBJECT. The different lock types are represented by the values of the enum IRWLockManager.LockType

    The locking semantics established by this class are as follows:

    • A read lock prevents a write lock by another, but allows read locks by others and allows a write option by another, and is therefore non-exclusive.
    • A write lock prevents read locks by others, a write lock by another, and a write option by another, and is therefore exclusive.
    • A write option prevents write locks by others and a write option by another, but allows read locks by others, and is therefore exclusive.
    Since:
    3.2
    Author:
    Caspar De Groot
    • Method Detail

      • getLockedObject

        public OBJECT getLockedObject()
      • getReadLockOwners

        public java.util.Set<CONTEXT> getReadLockOwners()
      • getWriteLockOwner

        public CONTEXT getWriteLockOwner()
      • getWriteOptionOwner

        public CONTEXT getWriteOptionOwner()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object