|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hazelcast.util.FutureUtil
public final class FutureUtil
This utility class contains convenience methods to work with multiple
futures at the same time, e.g.
waitWithDeadline(java.util.Collection, long, java.util.concurrent.TimeUnit, long, java.util.concurrent.TimeUnit)
| Nested Class Summary | |
|---|---|
static interface |
FutureUtil.ExceptionHandler
Internally used interface to define behavior of the FutureUtil methods when exceptions arise |
| Field Summary | |
|---|---|
static FutureUtil.ExceptionHandler |
IGNORE_ALL_EXCEPT_LOG_MEMBER_LEFT
Ignores all exceptions but still logs MemberLeftException per future and just tries
to finish all of the given ones. |
static FutureUtil.ExceptionHandler |
IGNORE_ALL_EXCEPTIONS
Ignores all exceptions |
static FutureUtil.ExceptionHandler |
RETHROW_EVERYTHING
Just rethrows all exceptions |
static FutureUtil.ExceptionHandler |
RETHROW_EXECUTION_EXCEPTION
This ExceptionHandler rethrows ExecutionExceptions and logs
MemberLeftExceptions to the log. |
static FutureUtil.ExceptionHandler |
RETHROW_TRANSACTION_EXCEPTION
Handler for transaction specific rethrown of exceptions. |
| Method Summary | ||
|---|---|---|
static FutureUtil.ExceptionHandler |
logAllExceptions(ILogger logger,
Level level)
This ExceptionHandler rethrows ExecutionExceptions and logs
MemberLeftExceptions to the log. |
|
static FutureUtil.ExceptionHandler |
logAllExceptions(ILogger logger,
String message,
Level level)
This ExceptionHandler rethrows ExecutionExceptions and logs
MemberLeftExceptions to the log. |
|
static FutureUtil.ExceptionHandler |
logAllExceptions(Level level)
This ExceptionHandler rethrows ExecutionExceptions and logs
MemberLeftExceptions to the log. |
|
static FutureUtil.ExceptionHandler |
logAllExceptions(String message,
Level level)
This ExceptionHandler rethrows ExecutionExceptions and logs
MemberLeftExceptions to the log. |
|
static
|
returnWithDeadline(Collection<Future<V>> futures,
long timeout,
TimeUnit timeUnit)
|
|
static
|
returnWithDeadline(Collection<Future<V>> futures,
long timeout,
TimeUnit timeUnit,
FutureUtil.ExceptionHandler exceptionHandler)
|
|
static
|
returnWithDeadline(Collection<Future<V>> futures,
long overallTimeout,
TimeUnit overallTimeUnit,
long perFutureTimeout,
TimeUnit perFutureTimeUnit)
|
|
static
|
returnWithDeadline(Collection<Future<V>> futures,
long overallTimeout,
TimeUnit overallTimeUnit,
long perFutureTimeout,
TimeUnit perFutureTimeUnit,
FutureUtil.ExceptionHandler exceptionHandler)
|
|
static void |
waitWithDeadline(Collection<Future> futures,
long timeout,
TimeUnit timeUnit)
|
|
static void |
waitWithDeadline(Collection<Future> futures,
long timeout,
TimeUnit timeUnit,
FutureUtil.ExceptionHandler exceptionHandler)
|
|
static void |
waitWithDeadline(Collection<Future> futures,
long overallTimeout,
TimeUnit overallTimeUnit,
long perFutureTimeout,
TimeUnit perFutureTimeUnit)
|
|
static void |
waitWithDeadline(Collection<Future> futures,
long overallTimeout,
TimeUnit overallTimeUnit,
long perFutureTimeout,
TimeUnit perFutureTimeUnit,
FutureUtil.ExceptionHandler exceptionHandler)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final FutureUtil.ExceptionHandler RETHROW_EVERYTHING
public static final FutureUtil.ExceptionHandler IGNORE_ALL_EXCEPTIONS
public static final FutureUtil.ExceptionHandler IGNORE_ALL_EXCEPT_LOG_MEMBER_LEFT
MemberLeftException per future and just tries
to finish all of the given ones. This is the default behavior if nothing else is given.
public static final FutureUtil.ExceptionHandler RETHROW_EXECUTION_EXCEPTION
ExecutionExceptions and logs
MemberLeftExceptions to the log.
public static final FutureUtil.ExceptionHandler RETHROW_TRANSACTION_EXCEPTION
| Method Detail |
|---|
@PrivateApi
public static FutureUtil.ExceptionHandler logAllExceptions(ILogger logger,
String message,
Level level)
ExecutionExceptions and logs
MemberLeftExceptions to the log.
logger - the ILogger instance to be used for loggingmessage - the log message to appear in the logs before the stacktracelevel - the log level to be used for logging
@PrivateApi
public static FutureUtil.ExceptionHandler logAllExceptions(String message,
Level level)
ExecutionExceptions and logs
MemberLeftExceptions to the log.
message - the log message to appear in the logs before the stacktracelevel - the log level to be used for logging
@PrivateApi
public static FutureUtil.ExceptionHandler logAllExceptions(ILogger logger,
Level level)
ExecutionExceptions and logs
MemberLeftExceptions to the log.
logger - the ILogger instance to be used for logginglevel - the log level to be used for logging@PrivateApi public static FutureUtil.ExceptionHandler logAllExceptions(Level level)
ExecutionExceptions and logs
MemberLeftExceptions to the log.
level - the log level to be used for logging
@PrivateApi
public static <V> Collection<V> returnWithDeadline(Collection<Future<V>> futures,
long timeout,
TimeUnit timeUnit)
@PrivateApi
public static <V> Collection<V> returnWithDeadline(Collection<Future<V>> futures,
long timeout,
TimeUnit timeUnit,
FutureUtil.ExceptionHandler exceptionHandler)
@PrivateApi
public static <V> Collection<V> returnWithDeadline(Collection<Future<V>> futures,
long overallTimeout,
TimeUnit overallTimeUnit,
long perFutureTimeout,
TimeUnit perFutureTimeUnit)
@PrivateApi
public static <V> Collection<V> returnWithDeadline(Collection<Future<V>> futures,
long overallTimeout,
TimeUnit overallTimeUnit,
long perFutureTimeout,
TimeUnit perFutureTimeUnit,
FutureUtil.ExceptionHandler exceptionHandler)
@PrivateApi
public static void waitWithDeadline(Collection<Future> futures,
long timeout,
TimeUnit timeUnit)
@PrivateApi
public static void waitWithDeadline(Collection<Future> futures,
long timeout,
TimeUnit timeUnit,
FutureUtil.ExceptionHandler exceptionHandler)
@PrivateApi
public static void waitWithDeadline(Collection<Future> futures,
long overallTimeout,
TimeUnit overallTimeUnit,
long perFutureTimeout,
TimeUnit perFutureTimeUnit)
@PrivateApi
public static void waitWithDeadline(Collection<Future> futures,
long overallTimeout,
TimeUnit overallTimeUnit,
long perFutureTimeout,
TimeUnit perFutureTimeUnit,
FutureUtil.ExceptionHandler exceptionHandler)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||