public class ConcurrencyTools
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkThreadInterrupted(java.lang.String msg,
org.apache.log4j.Logger logger)
Convenience method that will check if the current thread was interrupted and if that is the case log the given
message to the given logger (Level WARN) and throw an
InterruptedException. |
static java.lang.Object |
evaluateFuture(java.util.concurrent.Future future,
org.apache.log4j.Logger logger,
boolean doThrow,
java.lang.String text)
Blocks until all passed Futures have completed.
|
static java.lang.Object |
evaluateFuture(java.util.concurrent.Future future,
org.apache.log4j.Logger logger,
boolean doThrow,
java.lang.String progressStart,
java.lang.String progress,
java.lang.String progressFinish)
Blocks until the passed Future has completed.
|
static java.util.List<java.lang.Object> |
evaluateFutures(java.util.List<java.util.concurrent.Future> futures,
org.apache.log4j.Logger logger,
boolean doThrow,
java.lang.String text)
Blocks until all passed Futures have completed.
|
static java.util.List<java.lang.Object> |
evaluateFutures(java.util.List<java.util.concurrent.Future> futures,
org.apache.log4j.Logger logger,
boolean doThrow,
java.lang.String progressStart,
java.lang.String progress,
java.lang.String progressFinish)
Blocks until all passed Futures have completed.
|
static int |
getReasonableParallelity()
Returns the number of parallel tasks the system can handle without overloading,
based on the number of available processors and predefined rules to reserve CPUs
for system tasks.
|
public static final int getReasonableParallelity()
Note: This is an idealized number assuming minimal other parallel work on the system.
Rules for parallel task calculation:
public static final java.lang.Object evaluateFuture(java.util.concurrent.Future future,
org.apache.log4j.Logger logger,
boolean doThrow,
java.lang.String progressStart,
java.lang.String progress,
java.lang.String progressFinish)
public static final java.lang.Object evaluateFuture(java.util.concurrent.Future future,
org.apache.log4j.Logger logger,
boolean doThrow,
java.lang.String text)
public static final java.util.List<java.lang.Object> evaluateFutures(java.util.List<java.util.concurrent.Future> futures,
org.apache.log4j.Logger logger,
boolean doThrow,
java.lang.String progressStart,
java.lang.String progress,
java.lang.String progressFinish)
public static final java.util.List<java.lang.Object> evaluateFutures(java.util.List<java.util.concurrent.Future> futures,
org.apache.log4j.Logger logger,
boolean doThrow,
java.lang.String text)
public static final void checkThreadInterrupted(java.lang.String msg,
org.apache.log4j.Logger logger)
throws java.lang.InterruptedException
InterruptedException.java.lang.InterruptedExceptionCopyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.