com.hazelcast.client.proxy
Class ClientSemaphoreProxy

java.lang.Object
  extended by com.hazelcast.client.spi.ClientProxy
      extended by com.hazelcast.client.proxy.ClientSemaphoreProxy
All Implemented Interfaces:
DistributedObject, ISemaphore

public class ClientSemaphoreProxy
extends ClientProxy
implements ISemaphore


Constructor Summary
ClientSemaphoreProxy(String serviceName, String objectId)
           
 
Method Summary
 void acquire()
           
 void acquire(int permits)
           
 int availablePermits()
           
 int drainPermits()
           
 Data getKey()
           
 boolean init(int permits)
           
protected
<T> T
invoke(ClientRequest req)
           
 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)
           
 
Methods inherited from class com.hazelcast.client.spi.ClientProxy
destroy, equals, getContext, getId, getName, getPartitionKey, getServiceName, hashCode, invoke, invoke, invokeInterruptibly, listen, listen, onDestroy, onInitialize, onShutdown, setContext, stopListening, throwExceptionIfNull, toData, toObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hazelcast.core.ISemaphore
getName
 
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getId, getPartitionKey, getServiceName
 

Constructor Detail

ClientSemaphoreProxy

public ClientSemaphoreProxy(String serviceName,
                            String objectId)
Method Detail

init

public boolean init(int permits)
Specified by:
init in interface ISemaphore

acquire

public void acquire()
             throws InterruptedException
Specified by:
acquire in interface ISemaphore
Throws:
InterruptedException

acquire

public void acquire(int permits)
             throws InterruptedException
Specified by:
acquire in interface ISemaphore
Throws:
InterruptedException

availablePermits

public int availablePermits()
Specified by:
availablePermits in interface ISemaphore

drainPermits

public int drainPermits()
Specified by:
drainPermits in interface ISemaphore

reducePermits

public void reducePermits(int reduction)
Specified by:
reducePermits in interface ISemaphore

release

public void release()
Specified by:
release in interface ISemaphore

release

public void release(int permits)
Specified by:
release in interface ISemaphore

tryAcquire

public boolean tryAcquire()
Specified by:
tryAcquire in interface ISemaphore

tryAcquire

public boolean tryAcquire(int permits)
Specified by:
tryAcquire in interface ISemaphore

tryAcquire

public boolean tryAcquire(long timeout,
                          TimeUnit unit)
                   throws InterruptedException
Specified by:
tryAcquire in interface ISemaphore
Throws:
InterruptedException

tryAcquire

public boolean tryAcquire(int permits,
                          long timeout,
                          TimeUnit unit)
                   throws InterruptedException
Specified by:
tryAcquire in interface ISemaphore
Throws:
InterruptedException

invoke

protected <T> T invoke(ClientRequest req)
Overrides:
invoke in class ClientProxy

getKey

public Data getKey()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.