public interface LockingService
For realizing the purpose of ACID and strong consistency, the LocalDocumentStore
is the place where locking and transactions are tied together.
Modifier and Type | Method and Description |
---|---|
boolean |
shutdown()
Shuts down this locking service.
|
boolean |
tryLock(long time,
TimeUnit unit,
String... names)
Attempts to acquire a series of locks, waiting a maximum amount of time to obtain each lock.
|
boolean |
tryLock(String... names)
Attempts to acquire a series of locks using the default lock timeout.
|
boolean |
unlock(String... names)
Unlocks a number of locks.
|
boolean tryLock(long time, TimeUnit unit, String... names) throws InterruptedException
NOTE: Implementors must make sure that either all the locks are obtained, or none. Otherwise possible deadlocks can occur.
time
- an amount of timeunit
- a TimeUnit
; may not be nullnames
- the names of the locks to acquiretrue
if *all* the locks were successfully acquired, false
otherwiseInterruptedException
- if this thread is interrupted while waiting to obtain the locksboolean tryLock(String... names) throws InterruptedException
NOTE: Implementors must make sure that either all the locks are obtained, or none. Otherwise possible deadlocks can occur.
names
- the names of the locks to acquiretrue
if *all* the locks were successfully acquired, false
otherwiseInterruptedException
- if this thread is interrupted while waiting to obtain the locksboolean unlock(String... names)
names
- the names of the locks to unlocktrue
if all the locks were successfully unlocked and false
if at least one lock could not be
released.boolean shutdown()
true
if the service was shutdown successfully or false
if the service was already shutdown prior
to this call.Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.