@NotThreadSafe public class H2DBLock extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SLEEP_COUNT
Max attempts to obtain a lock.
|
static int |
SLEEP_DURATION
How long to sleep waiting for the lock.
|
| Constructor and Description |
|---|
H2DBLock(Settings settings)
Constructs a new H2DB Lock object with the configured settings.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isLocked()
Determine if the lock is currently held.
|
void |
lock()
Obtains a lock on the H2 database.
|
void |
release()
Releases the lock on the H2 database.
|
public static final int SLEEP_DURATION
public static final int MAX_SLEEP_COUNT
public H2DBLock(Settings settings)
settings - the configured settingspublic boolean isLocked()
public void lock()
throws H2DBLockException
H2DBLockException - thrown if a lock could not be obtainedpublic void release()
Copyright © 2012–2020 OWASP. All rights reserved.