io.sarl.sre.janus.services.executor
Class Runnables
final class Runnables
extends java.lang.Object
Utilities for runnables and callables.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Since:
0.10
Action Summary
Modifier and type Action and description
static java.lang.Runnable named(Runnable,String)
Create a wrapper with a specific thread name.
static SreCallable<T> protectCallable(Callable<V>,Logger)
Create a task with the given callable.
static SreConsumer<T> protectConsumer(Consumer<T>,Logger)
Create a task with the given consumer.
static SreRunnable protectRunnable(Runnable,Logger)
Create a task with the given runnable.
Action Details
named(Runnable,String)
def named(Runnable,String) : java.lang.Runnable
Create a wrapper with a specific thread name.
Parameters:
runnable - the task to wrap.
name - the new name of the associated, if not null.
Returns:
the wrapping task.
Since:
0.10
protectCallable(Callable<V>,Logger)
def protectCallable(Callable<V>,Logger) : SreCallable<T>

with T

Create a task with the given callable.
Parameters:
<T> - the type of the returned value.
callable - the callable.
logger - the logger to use.
Returns:
the task.
protectConsumer(Consumer<T>,Logger)
def protectConsumer(Consumer<T>,Logger) : SreConsumer<T>

with T

Create a task with the given consumer.
Parameters:
<T> - the type of the returned value.
consumer - the consumer.
logger - the logger to use.
Returns:
the task.
protectRunnable(Runnable,Logger)
def protectRunnable(Runnable,Logger) : SreRunnable
Create a task with the given runnable.
Parameters:
runnable - the runnable.
logger - the logger to use.
Returns:
the task.