Class Uninterruptibles
- java.lang.Object
-
- com.google.common.util.concurrent.Uninterruptibles
-
@Beta @Deprecated(since="2022-12-01") public final class Uninterruptibles extends java.lang.Object
Deprecated.The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023Utilities 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
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
awaitUninterruptibly(java.util.concurrent.CountDownLatch latch)
Deprecated.Invokeslatch.
await()
uninterruptibly.static boolean
awaitUninterruptibly(java.util.concurrent.CountDownLatch latch, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.Invokeslatch.
await(timeout, unit)
uninterruptibly.static <V> V
getUninterruptibly(java.util.concurrent.Future<V> future)
Deprecated.Invokesfuture.
get()
uninterruptibly.static <V> V
getUninterruptibly(java.util.concurrent.Future<V> future, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.Invokesfuture.
get(timeout, unit)
uninterruptibly.static void
joinUninterruptibly(java.lang.Thread toJoin)
Deprecated.InvokestoJoin.
join()
uninterruptibly.static void
joinUninterruptibly(java.lang.Thread toJoin, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.Invokesunit.
timedJoin(toJoin, timeout)
uninterruptibly.static <E> void
putUninterruptibly(java.util.concurrent.BlockingQueue<E> queue, E element)
Deprecated.Invokesqueue.
put(element)
uninterruptibly.static void
sleepUninterruptibly(long sleepFor, java.util.concurrent.TimeUnit unit)
Deprecated.Invokesunit.
sleep(sleepFor)
uninterruptibly.static <E> E
takeUninterruptibly(java.util.concurrent.BlockingQueue<E> queue)
Deprecated.Invokesqueue.
take()
uninterruptibly.
-
-
-
Method Detail
-
awaitUninterruptibly
public static void awaitUninterruptibly(java.util.concurrent.CountDownLatch latch)
Deprecated.Invokeslatch.
await()
uninterruptibly.
-
awaitUninterruptibly
public static boolean awaitUninterruptibly(java.util.concurrent.CountDownLatch latch, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.Invokeslatch.
await(timeout, unit)
uninterruptibly.
-
joinUninterruptibly
public static void joinUninterruptibly(java.lang.Thread toJoin)
Deprecated.InvokestoJoin.
join()
uninterruptibly.
-
getUninterruptibly
public static <V> V getUninterruptibly(java.util.concurrent.Future<V> future) throws java.util.concurrent.ExecutionException
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>)
.- Throws:
java.util.concurrent.ExecutionException
- if the computation threw an exceptionCancellationException
- if the computation was cancelled
-
getUninterruptibly
public static <V> V getUninterruptibly(java.util.concurrent.Future<V> future, long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.ExecutionException, java.util.concurrent.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>)
.- Throws:
java.util.concurrent.ExecutionException
- if the computation threw an exceptionCancellationException
- if the computation was cancelledjava.util.concurrent.TimeoutException
- if the wait timed out
-
joinUninterruptibly
public static void joinUninterruptibly(java.lang.Thread toJoin, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.Invokesunit.
timedJoin(toJoin, timeout)
uninterruptibly.
-
takeUninterruptibly
public static <E> E takeUninterruptibly(java.util.concurrent.BlockingQueue<E> queue)
Deprecated.Invokesqueue.
take()
uninterruptibly.
-
putUninterruptibly
public static <E> void putUninterruptibly(java.util.concurrent.BlockingQueue<E> queue, E element)
Deprecated.Invokesqueue.
put(element)
uninterruptibly.- Throws:
java.lang.ClassCastException
- if the class of the specified element prevents it from being added to the given queuejava.lang.IllegalArgumentException
- if some property of the specified element prevents it from being added to the given queue
-
sleepUninterruptibly
public static void sleepUninterruptibly(long sleepFor, java.util.concurrent.TimeUnit unit)
Deprecated.Invokesunit.
sleep(sleepFor)
uninterruptibly.
-
-