public interface LockManager
Modifier and Type | Field and Description |
---|---|
static short |
LOCK_MODE_NONE
Lock mode representing no locking.
|
static short |
LOCK_MODE_OPTIMISTIC_READ
Lock mode for optimistic reads.
|
static short |
LOCK_MODE_OPTIMISTIC_WRITE
Lock mode for optimistic writes.
|
static short |
LOCK_MODE_PESSIMISTIC_READ
Lock mode for pessimistic reads.
|
static short |
LOCK_MODE_PESSIMISTIC_WRITE
Lock mode for pessimistic writes.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Method to clear all settings of required lock level for object ids (mode 2).
|
void |
close()
Method to close the manager and release resources.
|
short |
getLockMode(Object id)
Accessor for what locking should be applied to the object with the specified identity (mode 2).
|
short |
getLockMode(ObjectProvider op)
Accessor for the current lock mode for the object managed by the passed ObjectProvider (mode 1).
|
void |
lock(ObjectProvider op,
short lockMode)
Method to lock the object managed by the passed ObjectProvider (mode 1).
|
void |
lock(Object id,
short lockMode)
Method to lock the object with the provided identity (mode 2).
|
void |
unlock(ObjectProvider op)
Method to unlock the object managed by the passed ObjectProvider (mode 1).
|
static final short LOCK_MODE_NONE
static final short LOCK_MODE_OPTIMISTIC_READ
static final short LOCK_MODE_OPTIMISTIC_WRITE
static final short LOCK_MODE_PESSIMISTIC_READ
static final short LOCK_MODE_PESSIMISTIC_WRITE
void lock(Object id, short lockMode)
id
- Identity of the objectlockMode
- mode for lockingshort getLockMode(Object id)
id
- The identityvoid clear()
void lock(ObjectProvider op, short lockMode)
op
- ObjectProvider for the objectlockMode
- mode for lockingvoid unlock(ObjectProvider op)
op
- ObjectProvider for the objectshort getLockMode(ObjectProvider op)
op
- ObjectProvider for the objectvoid close()
Copyright © 2017. All rights reserved.