public interface DatabaseSemaphore extends BatchComponent, ServerComponent
Modifier and Type | Interface and Description |
---|---|
static class |
DatabaseSemaphore.Lock |
Modifier and Type | Method and Description |
---|---|
DatabaseSemaphore.Lock |
acquire(String name)
Try to acquire the lock on a name.
|
DatabaseSemaphore.Lock |
acquire(String name,
int maxDurationInSeconds)
Try to acquire a lock on a name, for a given duration.
|
void |
release(String name)
Release the lock on a semaphore by its name.
|
DatabaseSemaphore.Lock acquire(String name, int maxDurationInSeconds)
name
- the key of the semaphoremaxDurationInSeconds
- the max duration in seconds the semaphore will be acquired (a value of zero can be used to always acquire a lock)DatabaseSemaphore.Lock acquire(String name)
name
- the key of the semaphoreCopyright © 2009-2012 SonarSource. All Rights Reserved.