Class Uninterruptibles
java.lang.Object
com.google.common.util.concurrent.Uninterruptibles
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
Utilities for treating interruptible operations as uninterruptible.
In all cases, if a thread is interrupted during such a call, the call
continues to block until the result is available or the timeout elapses,
and only then re-interrupts the thread.
- Since:
- 10.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Deprecated.Invokeslatch.
await()
uninterruptibly.static boolean
awaitUninterruptibly
(CountDownLatch latch, long timeout, TimeUnit unit) Deprecated.Invokeslatch.
await(timeout, unit)
uninterruptibly.static <V> V
getUninterruptibly
(Future<V> future) Deprecated.Invokesfuture.
get()
uninterruptibly.static <V> V
getUninterruptibly
(Future<V> future, long timeout, TimeUnit unit) Deprecated.Invokesfuture.
get(timeout, unit)
uninterruptibly.static void
joinUninterruptibly
(Thread toJoin) Deprecated.InvokestoJoin.
join()
uninterruptibly.static void
joinUninterruptibly
(Thread toJoin, long timeout, TimeUnit unit) Deprecated.Invokesunit.
timedJoin(toJoin, timeout)
uninterruptibly.static <E> void
putUninterruptibly
(BlockingQueue<E> queue, E element) Deprecated.Invokesqueue.
put(element)
uninterruptibly.static void
sleepUninterruptibly
(long sleepFor, TimeUnit unit) Deprecated.Invokesunit.
sleep(sleepFor)
uninterruptibly.static <E> E
takeUninterruptibly
(BlockingQueue<E> queue) Deprecated.Invokesqueue.
take()
uninterruptibly.
-
Method Details
-
awaitUninterruptibly
Deprecated.Invokeslatch.
await()
uninterruptibly. -
awaitUninterruptibly
Deprecated.Invokeslatch.
await(timeout, unit)
uninterruptibly. -
joinUninterruptibly
Deprecated.InvokestoJoin.
join()
uninterruptibly. -
getUninterruptibly
Deprecated.Invokesfuture.
get()
uninterruptibly. To get uninterruptibility and remove checked exceptions, seeFutures.getUnchecked(java.util.concurrent.Future<V>)
.If instead, you wish to treat
InterruptedException
uniformly with other exceptions, seeFutures.get
orFutures.makeChecked(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.base.Function<java.lang.Exception, X>)
. -
getUninterruptibly
public static <V> V getUninterruptibly(Future<V> future, long timeout, TimeUnit unit) throws ExecutionException, TimeoutException Deprecated.Invokesfuture.
get(timeout, unit)
uninterruptibly.If instead, you wish to treat
InterruptedException
uniformly with other exceptions, seeFutures.get
orFutures.makeChecked(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.base.Function<java.lang.Exception, X>)
. -
joinUninterruptibly
Deprecated.Invokesunit.
timedJoin(toJoin, timeout)
uninterruptibly. -
takeUninterruptibly
Deprecated.Invokesqueue.
take()
uninterruptibly. -
putUninterruptibly
Deprecated.Invokesqueue.
put(element)
uninterruptibly.- Throws:
ClassCastException
- if the class of the specified element prevents it from being added to the given queueIllegalArgumentException
- if some property of the specified element prevents it from being added to the given queue
-
sleepUninterruptibly
Deprecated.Invokesunit.
sleep(sleepFor)
uninterruptibly.
-