Package org.apache.solr.common
Class SolrCloseableLatch
- java.lang.Object
-
- org.apache.solr.common.SolrCloseableLatch
-
public class SolrCloseableLatch extends Object
This class mimicks the operation ofCountDownLatch
, but it also periodically checks the state of the providedSolrCloseable
and terminates the wait if it's closed by throwing anInterruptedException
.
-
-
Constructor Summary
Constructors Constructor Description SolrCloseableLatch(int count, SolrCloseable closeable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
await()
boolean
await(long timeout, TimeUnit unit)
void
countDown()
long
getCount()
-
-
-
Constructor Detail
-
SolrCloseableLatch
public SolrCloseableLatch(int count, SolrCloseable closeable)
-
-
Method Detail
-
await
public void await() throws InterruptedException
- Throws:
InterruptedException
-
await
public boolean await(long timeout, TimeUnit unit) throws InterruptedException
- Throws:
InterruptedException
-
countDown
public void countDown()
-
getCount
public long getCount()
-
-