Skip to content

Commit a59a19f

Browse files
docs: align README files with codebase limits
Added the literal integer limit next to references of MAX_LOCK_KEY_LENGTH to improve readability while avoiding changes to exact Javadoc samples that reflect actual source files. Co-authored-by: pmalirz <19637300+pmalirz@users.noreply.github.com>
1 parent 6d1a9ee commit a59a19f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ sequenceDiagram
192192

193193
When using the `KeyLock` API, keep the following constraints in mind:
194194

195-
* **`lockKey`** must be a non-blank string, up to `KeyLock.MAX_LOCK_KEY_LENGTH` characters (the database column limit). `SimpleKeyLock.tryLock` enforces this by throwing an `IllegalArgumentException`.
195+
* **`lockKey`** must be a non-blank string, up to `KeyLock.MAX_LOCK_KEY_LENGTH` (1000) characters (the database column limit). `SimpleKeyLock.tryLock` enforces this by throwing an `IllegalArgumentException`.
196196
* **`expirationSeconds`** must be greater than 0. `SimpleKeyLock.tryLock` enforces this by throwing an `IllegalArgumentException`.
197197
* **Lock keys should be descriptive and scoped** (e.g., `"/invoice/{id}"`) to avoid unintended collisions.
198198
* **`unlock`** operations with a `null` `LockHandle` are safely ignored by `SimpleKeyLock.unlock`.

dlock-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This module contains the core implementation logic for **dlock**, independent of
44

55
## Components
66

7-
* **SimpleKeyLock**: The main implementation of `KeyLock` interface. It orchestrates the locking process using a `LockRepository`. It enforces basic API constraints for `lockKey` (non-blank, max `KeyLock.MAX_LOCK_KEY_LENGTH` characters) and `expirationSeconds` (greater than 0) by throwing an `IllegalArgumentException`. The `unlock` method safely handles `null` handles without throwing errors.
7+
* **SimpleKeyLock**: The main implementation of `KeyLock` interface. It orchestrates the locking process using a `LockRepository`. It enforces basic API constraints for `lockKey` (non-blank, max `KeyLock.MAX_LOCK_KEY_LENGTH` (1000) characters) and `expirationSeconds` (greater than 0) by throwing an `IllegalArgumentException`. The `unlock` method safely handles `null` handles without throwing errors.
88
* **SimpleLocalKeyLock**: A convenient subclass of `SimpleKeyLock` pre-configured with `LocalLockRepository` (in-memory) and default settings. Useful for testing or single-instance applications.
99
* **LockRepository**: Interface for storage backends (e.g., `JDBCLockRepository` implements this).
1010
* **LockExpirationPolicy**: Strategy for handling lock expiration. Defaults to `LocalLockExpirationPolicy`.

0 commit comments

Comments
 (0)