public class ClientSemaphoreProxy extends ClientProxy implements ISemaphore
ISemaphore.name| Constructor and Description |
|---|
ClientSemaphoreProxy(String serviceName,
String objectId,
ClientContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquire() |
void |
acquire(int permits) |
int |
availablePermits() |
int |
drainPermits() |
void |
increasePermits(int increase) |
boolean |
init(int permits) |
protected ClientMessage |
invokeOnPartition(ClientMessage req) |
protected <T> ClientDelegatingFuture<T> |
invokeOnPartitionAsync(ClientMessage clientMessage,
ClientMessageDecoder clientMessageDecoder) |
protected <T> T |
invokeOnPartitionInterruptibly(ClientMessage clientMessage) |
protected void |
onInitialize()
Called when proxy is created.
|
void |
reducePermits(int reduction) |
void |
release() |
void |
release(int permits) |
String |
toString() |
boolean |
tryAcquire() |
boolean |
tryAcquire(int permits) |
boolean |
tryAcquire(int permits,
long timeout,
TimeUnit unit) |
boolean |
tryAcquire(long timeout,
TimeUnit unit) |
deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getConnectedServerVersion, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onShutdown, postDestroy, preDestroy, registerListener, setContext, toData, toObjectclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetNamedestroy, getPartitionKey, getServiceNamepublic ClientSemaphoreProxy(String serviceName, String objectId, ClientContext context)
public boolean init(int permits)
init in interface ISemaphorepublic void acquire()
throws InterruptedException
acquire in interface ISemaphoreInterruptedExceptionpublic void acquire(int permits)
throws InterruptedException
acquire in interface ISemaphoreInterruptedExceptionpublic int availablePermits()
availablePermits in interface ISemaphorepublic int drainPermits()
drainPermits in interface ISemaphorepublic void reducePermits(int reduction)
reducePermits in interface ISemaphorepublic void increasePermits(int increase)
increasePermits in interface ISemaphorepublic void release()
release in interface ISemaphorepublic void release(int permits)
release in interface ISemaphorepublic boolean tryAcquire()
tryAcquire in interface ISemaphorepublic boolean tryAcquire(int permits)
tryAcquire in interface ISemaphorepublic boolean tryAcquire(long timeout,
TimeUnit unit)
throws InterruptedException
tryAcquire in interface ISemaphoreInterruptedExceptionpublic boolean tryAcquire(int permits,
long timeout,
TimeUnit unit)
throws InterruptedException
tryAcquire in interface ISemaphoreInterruptedExceptionprotected void onInitialize()
ClientProxyonInitialize in class ClientProxyprotected ClientMessage invokeOnPartition(ClientMessage req)
protected <T> T invokeOnPartitionInterruptibly(ClientMessage clientMessage) throws InterruptedException
InterruptedExceptionprotected <T> ClientDelegatingFuture<T> invokeOnPartitionAsync(ClientMessage clientMessage, ClientMessageDecoder clientMessageDecoder)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.