com.sleepycat.je.rep.utilint
Class RepUtils.ExceptionAwareCountDownLatch
java.lang.Object
java.util.concurrent.CountDownLatch
com.sleepycat.je.rep.utilint.RepUtils.ExceptionAwareCountDownLatch
- Enclosing class:
- RepUtils
public static class RepUtils.ExceptionAwareCountDownLatch
- extends CountDownLatch
Like CountDownLatch, but makes provision in the await for the await, or
more specifically the new awaitOrException method to be exited via an
exception.
Method Summary |
boolean |
await(long timeout,
TimeUnit unit)
Deprecated. |
void |
awaitOrException()
|
boolean |
awaitOrException(long timeout,
TimeUnit unit)
Blocks, waiting for the latch to count down to zero, or until an
Exception is provided. |
void |
releaseAwait(Exception exception)
The method used to free an await, ensuring that it throws an
exception at the awaitOrException. |
envImpl
final EnvironmentImpl envImpl
RepUtils.ExceptionAwareCountDownLatch
public RepUtils.ExceptionAwareCountDownLatch(EnvironmentImpl envImpl,
int count)
releaseAwait
public void releaseAwait(Exception exception)
- The method used to free an await, ensuring that it throws an
exception at the awaitOrException.
- Parameters:
exception
- the exception to be wrapped in a DatabaseException
and thrown.
awaitOrException
public boolean awaitOrException(long timeout,
TimeUnit unit)
throws InterruptedException,
DatabaseException
- Blocks, waiting for the latch to count down to zero, or until an
Exception
is provided. The exception is thrown in every
thread that is waiting in this method.
- Throws:
InterruptedException
DatabaseException
- See Also:
releaseAwait(java.lang.Exception)
awaitOrException
public void awaitOrException()
throws InterruptedException,
DatabaseException
- Throws:
InterruptedException
DatabaseException
await
@Deprecated
public boolean await(long timeout,
TimeUnit unit)
- Deprecated.
- DO NOT use this method. Use awaitOrException instead, so that any
outstanding exceptions are thrown.
- Overrides:
await
in class CountDownLatch
Copyright (c) 2004-2012 Oracle. All rights reserved.