| 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.
|
L lock(LockMode lockMode, long timeout)
lockMode - Lock mode (not null)timeout - Lock timeout in milliseconds, -1 for defaultdefault L lock(LockMode lockMode)
lockMode - Lock mode (not null)default L lock(long timeout)
LockMode.getDefault() and configure the lock timeout, if supported by the concrete
implementation.timeout - Lock timeout in milliseconds, -1 for defaultdefault L lock()
LockMode.getDefault() and the lock timeout as the default value.boolean tryLock(LockMode lockMode, long timeout)
lockMode - Lock mode (not null)timeout - Lock timeout in milliseconds, -1 for defaulttrue if the lock is successfully acquired, false otherwisedefault boolean tryLock(LockMode lockMode)
lockMode - Lock mode (not null)true if the lock is successfully acquired, false otherwisedefault boolean tryLock(long timeout)
timeout - Lock timeout in milliseconds, -1 for defaulttrue if the lock is successfully acquired, false otherwiseLockMode.getDefault()default boolean tryLock()
true if the lock is successfully acquired, false otherwiseLockMode.getDefault()Copyright © 2019 The Holon Platform. All rights reserved.