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