Package org.eclipse.emf.cdo

## Interface CDOLock

- All Superinterfaces:
    `java.util.concurrent.locks.Lock`

      public interface CDOLock
      extends java.util.concurrent.locks.Lock

  A read or write lock on an `object` as returned by `CDOObject.cdoReadLock()` or `CDOObject.cdoWriteLock()`.
  Since:
    2.0
  Author:
    Simon McDuff
  No Implement
    This interface is not intended to be implemented by clients.
  No Extend
    This interface is not intended to be extended by clients.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `NO_WAIT` |
    `static int` | `WAIT` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CDOObject` | `getObject()` |
    `org.eclipse.net4j.util.concurrent.IRWLockManager.LockType` | `getType()` |
    `boolean` | `isLocked()` | Returns `true` if this lock is currently held by the requesting `view`, `false` otherwise.
    `boolean` | `isLockedByOthers()` | Returns `true` if this lock is currently held by another `view` (i.e.
    `void` | `lock​(long millis)` |
    `void` | `lock​(long time, java.util.concurrent.TimeUnit unit)` |
    `boolean` | `tryLock​(long millis)` |

    - ### Methods inherited from interface java.util.concurrent.locks.Lock

      `lock, lockInterruptibly, newCondition, tryLock, tryLock, unlock`

- - ### Field Detail

    - #### WAIT

          static final int WAIT

      See Also:
        Constant Field Values

    - #### NO_WAIT

          static final int NO_WAIT

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getObject

          CDOObject getObject()

      Since:
        4.8

    - #### getType

          org.eclipse.net4j.util.concurrent.IRWLockManager.LockType getType()

      Since:
        3.0

    - #### lock

          void lock​(long time,
                    java.util.concurrent.TimeUnit unit)
             throws java.util.concurrent.TimeoutException

      Throws:
        `java.util.concurrent.TimeoutException`
      Since:
        4.0

    - #### lock

          void lock​(long millis)
             throws java.util.concurrent.TimeoutException

      Throws:
        `java.util.concurrent.TimeoutException`
      Since:
        4.0

    - #### tryLock

          boolean tryLock​(long millis)
                   throws java.lang.InterruptedException

      Throws:
        `java.lang.InterruptedException`
      Since:
        4.0

    - #### isLocked

          boolean isLocked()

      Returns `true` if this lock is currently held by the requesting `view`, `false` otherwise.

    - #### isLockedByOthers

          boolean isLockedByOthers()

      Returns `true` if this lock is currently held by another `view` (i.e. any view different from the requesting one), `false` otherwise.