| Modifier and Type | Method and Description |
|---|---|
Object |
acquire(RaftGroupId groupId,
String name,
long sessionId,
long threadId,
UUID invocationUid,
int permits,
long timeoutMs)
Acquires the requested amount of permits if available, reducing
the number of available permits.
|
Object |
availablePermits(RaftGroupId groupId,
String name)
Returns the number of available permits.
|
Object |
change(RaftGroupId groupId,
String name,
long sessionId,
long threadId,
UUID invocationUid,
int permits)
Increases or decreases the number of permits by the given value.
|
Object |
drain(RaftGroupId groupId,
String name,
long sessionId,
long threadId,
UUID invocationUid)
Acquires all available permits at once and returns immediately.
|
Object |
getSemaphoreType(String proxyName)
Returns true if the semaphore is JDK compatible
|
Object |
init(RaftGroupId groupId,
String name,
int permits)
Initializes the ISemaphore instance with the given permit number, if not
initialized before.
|
Object |
release(RaftGroupId groupId,
String name,
long sessionId,
long threadId,
UUID invocationUid,
int permits)
Releases the given number of permits and increases the number of
available permits by that amount.
|
Object init(RaftGroupId groupId, String name, int permits)
groupId - CP group id of this ISemaphore instancename - Name of this ISemaphore instancepermits - Number of permits to initialize this ISemaphoreObject acquire(RaftGroupId groupId, String name, long sessionId, long threadId, UUID invocationUid, int permits, long timeoutMs)
groupId - CP group id of this ISemaphore instancename - Name of this ISemaphore instancesessionId - Session ID of the callerthreadId - ID of the caller threadinvocationUid - UID of this invocationpermits - number of permits to acquiretimeoutMs - Duration to wait for permit acquireObject release(RaftGroupId groupId, String name, long sessionId, long threadId, UUID invocationUid, int permits)
groupId - CP group id of this ISemaphore instancename - Name of this ISemaphore instancesessionId - Session ID of the callerthreadId - ID of the caller threadinvocationUid - UID of this invocationpermits - number of permits to releaseObject drain(RaftGroupId groupId, String name, long sessionId, long threadId, UUID invocationUid)
groupId - CP group id of this ISemaphore instancename - Name of this ISemaphore instancesessionId - Session ID of the callerthreadId - ID of the caller threadinvocationUid - UID of this invocationObject change(RaftGroupId groupId, String name, long sessionId, long threadId, UUID invocationUid, int permits)
groupId - CP group id of this ISemaphore instancename - Name of this ISemaphore instancesessionId - Session ID of the callerthreadId - ID of the caller threadinvocationUid - UID of this invocationpermits - number of permits to increase / decreaseObject availablePermits(RaftGroupId groupId, String name)
groupId - CP group id of this ISemaphore instancename - Name of this ISemaphore instanceCopyright © 2019. All Rights Reserved.