|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hazelcast.spi.AbstractDistributedObject<CountDownLatchService> com.hazelcast.concurrent.countdownlatch.CountDownLatchProxy
public class CountDownLatchProxy
Field Summary |
---|
Fields inherited from class com.hazelcast.spi.AbstractDistributedObject |
---|
PARTITIONING_STRATEGY |
Constructor Summary | |
---|---|
CountDownLatchProxy(String name,
NodeEngine nodeEngine)
|
Method Summary | |
---|---|
boolean |
await(long timeout,
TimeUnit unit)
Causes the current thread to wait until the latch has counted down to zero, or an exception is thrown, or the specified waiting time elapses. |
void |
countDown()
Decrements the count of the latch, releasing all waiting threads if the count reaches zero. |
int |
getCount()
Returns the current count. |
String |
getName()
Returns the unique name for this DistributedObject. |
String |
getServiceName()
Returns the service name for this object. |
String |
toString()
|
boolean |
trySetCount(int count)
Sets the count to the given value if the current count is zero. |
Methods inherited from class com.hazelcast.spi.AbstractDistributedObject |
---|
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveException |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.hazelcast.core.DistributedObject |
---|
destroy, getId, getPartitionKey |
Constructor Detail |
---|
public CountDownLatchProxy(String name, NodeEngine nodeEngine)
Method Detail |
---|
public String getName()
DistributedObject
getName
in interface DistributedObject
public boolean await(long timeout, TimeUnit unit) throws InterruptedException
ICountDownLatch
If the current count is zero then this method returns immediately
with the value true
.
If the current count is greater than zero, then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of five things happen:
ICountDownLatch.countDown()
method,
If the count reaches zero, then the method returns with the
value true
.
If the current thread:
InterruptedException
is thrown and the current thread's
interrupted status is cleared.
If the specified waiting time elapses then the value false
is returned. If the time is less than or equal to zero, the method
will not wait at all.
await
in interface ICountDownLatch
timeout
- the maximum time to waitunit
- the time unit of the timeout
argument
true
if the count reached zero, false
if the waiting time elapsed before the count reached zero
InterruptedException
- if the current thread is interruptedpublic void countDown()
ICountDownLatch
null
.
countDown
in interface ICountDownLatch
public int getCount()
ICountDownLatch
getCount
in interface ICountDownLatch
public boolean trySetCount(int count)
ICountDownLatch
false
.
trySetCount
in interface ICountDownLatch
count
- the number of times ICountDownLatch.countDown()
must be invoked
before threads can pass through ICountDownLatch.await(long, java.util.concurrent.TimeUnit)
true
if the new count was set, false
if the current
count is not zeropublic String getServiceName()
DistributedObject
getServiceName
in interface DistributedObject
getServiceName
in class AbstractDistributedObject<CountDownLatchService>
public String toString()
toString
in class AbstractDistributedObject<CountDownLatchService>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |