Package com.hazelcast.scheduledexecutor
Class TaskUtils
java.lang.Object
com.hazelcast.scheduledexecutor.TaskUtils
public final class TaskUtils extends Object
-
Method Summary
Modifier and Type Method Description static Runnable
autoDisposable(Runnable runnable)
Decorate anyRunnable
with aAutoDisposableTask
to destroy automatically after executionstatic <V> Callable<V>
autoDisposable(Callable<V> callable)
Decorate anyCallable
with aAutoDisposableTask
to destroy automatically after executionstatic Runnable
named(String name, Runnable runnable)
static <V> Callable<V>
named(String name, Callable<V> callable)
-
Method Details
-
named
- Parameters:
name
- The name that the task will haverunnable
- The runnable task to be named- Returns:
- A new Runnable implementing the
NamedTask
interface
-
named
- Type Parameters:
V
- The return type of callable task- Parameters:
name
- The name that the task will havecallable
- The callable task to be named- Returns:
- A new Callable implementing the
NamedTask
interface
-
autoDisposable
Decorate anyRunnable
with aAutoDisposableTask
to destroy automatically after execution- Parameters:
runnable
- The runnable task to be disposed automatically- Returns:
- A new Runnable implementing the
AutoDisposableTask
interface
-
autoDisposable
Decorate anyCallable
with aAutoDisposableTask
to destroy automatically after execution- Type Parameters:
V
- The return type of callable task- Parameters:
callable
- The callable task to be disposed automatically- Returns:
- A new Callable implementing the
AutoDisposableTask
interface
-