Class OpenLockAcquireException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.lock.exception.OpenLockException
cloud.opencode.base.lock.exception.OpenLockAcquireException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
Lock Acquisition Exception for Non-Timeout Failures
非超时失败的锁获取异常
Thrown when lock acquisition fails for reasons other than timeout, such as interruption or internal errors.
当锁获取因超时以外的原因(如中断或内部错误)而失败时抛出。
Common Causes | 常见原因:
- Thread interrupted during wait - 等待期间线程被中断
- Lock in invalid state - 锁处于无效状态
- Internal lock errors - 内部锁错误
Features | 主要功能:
- Core functionality for OpenLockAcquireException - OpenLockAcquireException的核心功能
Usage Examples | 使用示例:
// Handle lock acquisition failure
// 处理锁获取失败
try {
lock.tryLock(timeout);
} catch (OpenLockAcquireException e) {
log.warn("Could not acquire lock: {}", e.getMessage());
}
Security | 安全性:
- Thread-safe: Yes (immutable exception) - 线程安全: 是(不可变异常)
- Null-safe: No - 空值安全: 否
- Since:
- JDK 25, opencode-base-lock V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class OpenLockException
OpenLockException.LockErrorType -
Constructor Summary
ConstructorsConstructorDescriptionOpenLockAcquireException(String message) Constructs a new acquire exception with message 使用消息构造新的获取异常OpenLockAcquireException(String message, String lockName, Throwable cause) Constructs a new acquire exception with lock name and cause 使用锁名称和原因构造新的获取异常OpenLockAcquireException(String message, Throwable cause) Constructs a new acquire exception with message and cause 使用消息和原因构造新的获取异常 -
Method Summary
Methods inherited from class OpenLockException
errorType, lockNameMethods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OpenExceptionMeta
getMetaPrefix
-
Constructor Details
-
OpenLockAcquireException
Constructs a new acquire exception with message 使用消息构造新的获取异常- Parameters:
message- the error message | 错误消息
-
OpenLockAcquireException
-
OpenLockAcquireException
-