public interface SemaphoreCodecTemplate
Modifier and Type | Method and Description |
---|---|
void |
acquire(String name,
int permits)
Acquires the given number of permits if they are available, and returns immediately, reducing the number of
available permits by the given amount.
|
Object |
availablePermits(String name)
Returns the current number of permits currently available in this semaphore.
|
Object |
drainPermits(String name)
Acquires and returns all permits that are immediately available.
|
Object |
init(String name,
int permits)
Try to initialize this ISemaphore instance with the given permit count
|
void |
reducePermits(String name,
int reduction)
Shrinks the number of available permits by the indicated reduction.
|
void |
release(String name,
int permits)
Releases the given number of permits, increasing the number of available permits by that amount.
|
Object |
tryAcquire(String name,
int permits,
long timeout)
Acquires the given number of permits, if they are available, and returns immediately, with the value true,
reducing the number of available permits by the given amount.
|
Object init(String name, int permits)
name
- Name of the Semaphorepermits
- The given permit countvoid acquire(String name, int permits)
name
- Name of the Semaphorepermits
- The given permit countObject availablePermits(String name)
name
- Name of the SemaphoreObject drainPermits(String name)
name
- Name of the Semaphorevoid reducePermits(String name, int reduction)
name
- Name of the Semaphorereduction
- The number of permits to removevoid release(String name, int permits)
name
- Name of the Semaphorepermits
- The number of permits to removeObject tryAcquire(String name, int permits, long timeout)
name
- Name of the Semaphorepermits
- The number of permits to removetimeout
- The maximum time to wait for a permitCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.