public class CountDownLatchClientProxy extends Object implements ICountDownLatch
Instance.InstanceType| Constructor and Description |
|---|
CountDownLatchClientProxy(HazelcastClient hazelcastClient,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Causes the current thread to wait until the latch has counted down to
zero or an exception is thrown.
|
boolean |
await(long timeout,
TimeUnit unit)
Causes the current thread to wait until the latch has counted down to
zero, 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.
|
void |
destroy()
Destroys this instance cluster-wide.
|
int |
getCount() |
Object |
getId()
Returns the unique id for this instance.
|
Instance.InstanceType |
getInstanceType()
Returns instance type such as map, set, list, lock, topic, multimap, id generator
|
LocalCountDownLatchStats |
getLocalCountDownLatchStats() |
String |
getName()
Returns the name of this ICountDownLatch instance.
|
Member |
getOwner() |
boolean |
hasCount()
Returns whether the current count is greater than zero.
|
boolean |
setCount(int count)
Sets the count to the given value if the current count is zero.
|
public CountDownLatchClientProxy(HazelcastClient hazelcastClient, String name)
public void await()
throws InstanceDestroyedException,
MemberLeftException,
InterruptedException
ICountDownLatchIf the current count is zero then this method returns immediately.
If the current count is greater than zero then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of four things happen:
ICountDownLatch.countDown() method;
InstanceDestroyedException will be thrown.
If the countdown owner becomes disconnected while waiting then
MemberLeftException will be thrown.
If the current thread:
InterruptedException is thrown and the current thread's
interrupted status is cleared.await in interface ICountDownLatchInstanceDestroyedException - if the instance is destroyed while waitingMemberLeftException - if the countdown owner becomes disconnected while waitingInterruptedException - if the current thread is interruptedpublic boolean await(long timeout,
TimeUnit unit)
throws InstanceDestroyedException,
MemberLeftException,
InterruptedException
ICountDownLatchIf 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.
InstanceDestroyedException will be thrown.
If the countdown owner becomes disconnected while waiting then
MemberLeftException will be thrown.
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 ICountDownLatchtimeout - the maximum time to waitunit - the time unit of the timeout argumenttrue if the count reached zero and false
if the waiting time elapsed before the count reached zeroInstanceDestroyedException - if the instance is destroyed while waitingMemberLeftException - if the countdown owner becomes disconnected while waitingInterruptedException - if the current thread is interruptedpublic void countDown()
ICountDownLatchnull.
countDown in interface ICountDownLatchpublic int getCount()
public Member getOwner()
public boolean hasCount()
ICountDownLatchhasCount in interface ICountDownLatchtrue if count is greater than zeropublic boolean setCount(int count)
ICountDownLatchnull; and
MemberLeftException.
false.setCount in interface ICountDownLatchcount - the number of times ICountDownLatch.countDown() must be invoked
before threads can pass through ICountDownLatch.await()true if the new count was set or false if the current
count is not zeropublic void destroy()
Instancepublic Object getId()
Instancepublic Instance.InstanceType getInstanceType()
InstancegetInstanceType in interface Instancepublic String getName()
ICountDownLatchgetName in interface ICountDownLatchpublic LocalCountDownLatchStats getLocalCountDownLatchStats()
getLocalCountDownLatchStats in interface ICountDownLatchCopyright © 2013 Hazelcast, Inc.. All rights reserved.