com.holonplatform.core.query.lock

## Interface LockSupport<L extends LockSupport<L>>

- All Known Subinterfaces:
    LockQuery

      public interface LockSupport<L extends LockSupport<L>>

  Provides lock support for suitable `Datastore` operations.
  Since:
    5.2.0
  See Also:
    `LockQuery`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default L` | `lock()` Set the lock mode as `LockMode.getDefault()` and the lock timeout as the default value.
    `default L` | `lock(LockMode lockMode)` Configure the lock mode.
    `L` | `lock(LockMode lockMode, long timeout)` Configure the lock mode and lock timeout, if supported by the concrete implementation.
    `default L` | `lock(long timeout)` Set the lock mode as `LockMode.getDefault()` and configure the lock timeout, if supported by the concrete implementation.
    `default boolean` | `tryLock()` Try to perform the operation using the default lock mode.
    `default boolean` | `tryLock(LockMode lockMode)` Try to perform the operation using the given lock mode.
    `boolean` | `tryLock(LockMode lockMode, long timeout)` Try to perform the operation using the given lock mode and timeout.
    `default boolean` | `tryLock(long timeout)` Try to perform the operation using the default lock mode and given timeout.

- - ### Method Detail

    - #### lock

          L lock(LockMode lockMode,
                 long timeout)

      Configure the lock mode and lock timeout, if supported by the concrete implementation.
      Parameters:
        `lockMode` - Lock mode (not null)
        `timeout` - Lock timeout in milliseconds, `-1` for default
      Returns:
        The parent builder

    - #### lock

          default L lock(LockMode lockMode)

      Configure the lock mode.
      Parameters:
        `lockMode` - Lock mode (not null)
      Returns:
        The parent builder

    - #### lock

          default L lock(long timeout)

      Set the lock mode as `LockMode.getDefault()` and configure the lock timeout, if supported by the concrete implementation.
      Parameters:
        `timeout` - Lock timeout in milliseconds, `-1` for default
      Returns:
        The parent builder

    - #### lock

          default L lock()

      Set the lock mode as `LockMode.getDefault()` and the lock timeout as the default value.
      Returns:
        The parent builder

    - #### tryLock

          boolean tryLock(LockMode lockMode,
                          long timeout)

      Try to perform the operation using the given lock mode and timeout.
      Parameters:
        `lockMode` - Lock mode (not null)
        `timeout` - Lock timeout in milliseconds, `-1` for default
      Returns:
        `true` if the lock is successfully acquired, `false` otherwise

    - #### tryLock

          default boolean tryLock(LockMode lockMode)

      Try to perform the operation using the given lock mode.
      Parameters:
        `lockMode` - Lock mode (not null)
      Returns:
        `true` if the lock is successfully acquired, `false` otherwise

    - #### tryLock

          default boolean tryLock(long timeout)

      Try to perform the operation using the default lock mode and given timeout.
      Parameters:
        `timeout` - Lock timeout in milliseconds, `-1` for default
      Returns:
        `true` if the lock is successfully acquired, `false` otherwise
      See Also:
        `LockMode.getDefault()`

    - #### tryLock

          default boolean tryLock()

      Try to perform the operation using the default lock mode.
      Returns:
        `true` if the lock is successfully acquired, `false` otherwise
      See Also:
        `LockMode.getDefault()`

Copyright © 2019 The Holon Platform. All rights reserved.