public class LockAcquisitionException extends FlamingockException
This exception provides detailed context about lock failures including:
This exception should be used for all lock-related failures including acquisition timeouts, refresh failures, and lock release issues.
| Modifier and Type | Class and Description |
|---|---|
static class |
LockAcquisitionException.LockFailureType |
| Constructor and Description |
|---|
LockAcquisitionException(java.lang.String message,
LockAcquisitionException.LockFailureType failureType,
java.lang.String lockKey,
java.lang.String currentOwner,
java.lang.String requestingOwner,
java.time.Duration attemptDuration,
java.time.Duration configuredTimeout,
int retryAttempts,
java.time.LocalDateTime lockExpiration,
java.lang.Throwable cause)
Creates a new LockAcquisitionException with comprehensive lock context.
|
LockAcquisitionException(java.lang.String message,
LockAcquisitionException.LockFailureType failureType,
java.lang.Throwable cause)
Creates a LockAcquisitionException with minimal context (for backward compatibility).
|
| Modifier and Type | Method and Description |
|---|---|
java.time.Duration |
getAttemptDuration() |
java.time.Duration |
getConfiguredTimeout() |
java.lang.String |
getCurrentOwner() |
LockAcquisitionException.LockFailureType |
getFailureType() |
java.time.LocalDateTime |
getLockExpiration() |
java.lang.String |
getLockKey() |
java.lang.String |
getRequestingOwner() |
int |
getRetryAttempts() |
static LockAcquisitionException |
refreshFailed(java.lang.String lockKey,
java.time.LocalDateTime lockExpiration,
java.lang.Throwable cause)
Factory method for lock refresh failures.
|
static LockAcquisitionException |
timeout(java.lang.String lockKey,
java.lang.String currentOwner,
java.time.Duration attemptDuration,
java.time.Duration configuredTimeout,
int retryAttempts)
Factory method for lock acquisition timeouts.
|
toFlamingockExceptionpublic LockAcquisitionException(java.lang.String message,
LockAcquisitionException.LockFailureType failureType,
java.lang.String lockKey,
java.lang.String currentOwner,
java.lang.String requestingOwner,
java.time.Duration attemptDuration,
java.time.Duration configuredTimeout,
int retryAttempts,
java.time.LocalDateTime lockExpiration,
java.lang.Throwable cause)
message - descriptive error messagefailureType - the specific type of lock failurelockKey - the key/identifier of the lockcurrentOwner - who currently owns the lock (if known)requestingOwner - who was trying to acquire the lockattemptDuration - how long the acquisition attempt tookconfiguredTimeout - the configured lock timeoutretryAttempts - number of retry attempts madelockExpiration - when the current lock expires (if applicable)cause - the underlying exception that caused the failurepublic LockAcquisitionException(java.lang.String message,
LockAcquisitionException.LockFailureType failureType,
java.lang.Throwable cause)
message - descriptive error messagefailureType - the type of lock failurecause - the underlying exceptionpublic static LockAcquisitionException timeout(java.lang.String lockKey, java.lang.String currentOwner, java.time.Duration attemptDuration, java.time.Duration configuredTimeout, int retryAttempts)
lockKey - the lock that couldn't be acquiredcurrentOwner - who currently owns the lockattemptDuration - how long we triedconfiguredTimeout - the configured timeoutretryAttempts - number of retries attemptedpublic static LockAcquisitionException refreshFailed(java.lang.String lockKey, java.time.LocalDateTime lockExpiration, java.lang.Throwable cause)
lockKey - the lock that couldn't be refreshedlockExpiration - when the lock was set to expirecause - the underlying exceptionpublic LockAcquisitionException.LockFailureType getFailureType()
public java.lang.String getLockKey()
public java.lang.String getCurrentOwner()
public java.lang.String getRequestingOwner()
public java.time.Duration getAttemptDuration()
public java.time.Duration getConfiguredTimeout()
public int getRetryAttempts()
public java.time.LocalDateTime getLockExpiration()