Class OpenLockAcquireException

All Implemented Interfaces:
OpenExceptionMeta, Serializable

public class OpenLockAcquireException extends OpenLockException
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:
  • Constructor Details

    • OpenLockAcquireException

      public OpenLockAcquireException(String message)
      Constructs a new acquire exception with message 使用消息构造新的获取异常
      Parameters:
      message - the error message | 错误消息
    • OpenLockAcquireException

      public OpenLockAcquireException(String message, Throwable cause)
      Constructs a new acquire exception with message and cause 使用消息和原因构造新的获取异常
      Parameters:
      message - the error message | 错误消息
      cause - the cause | 原因
    • OpenLockAcquireException

      public OpenLockAcquireException(String message, String lockName, Throwable cause)
      Constructs a new acquire exception with lock name and cause 使用锁名称和原因构造新的获取异常
      Parameters:
      message - the error message | 错误消息
      lockName - the lock name | 锁名称
      cause - the cause | 原因