public interface OrderLockManager
| Modifier and Type | Method and Description |
|---|---|
Object |
acquireLock(Order order)
Blocks the requesting thread until able to acquire a lock for the given order.
|
void |
releaseLock(Object lockObject)
Releases the given lockObject and notifies any threads that are waiting on that object that they are able to
attempt to acquire the lock.
|
Object acquireLock(Order order)
releaseLock(Object), passing in the Object returned
from this call once their critical section has executed. The suggested idiom for this operation is:
Object lockObject = null;
try {
lockObject = orderLockManager.acquireLock(order);
// Do something
} finally {
orderLockManager.releaseLock(lockObject);
}order - releaseLock(Object) once
the operation that required a lock has completed.void releaseLock(Object lockObject)
lockObject - Copyright © 2015. All Rights Reserved.