| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | ManagedExecutors.
Adapter for Runnable to include ManagedTask interface methods. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final String | NULL_TASK_ERROR_MSG
Error message for null tasks. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: Returns theisShutdown() value if the current thread is a
ManageableThread created by ManagedThreadFactory, or
false if the current thread is not a ManageableThread.Utility method for checking the |
| public static Runnable | Returns: a Runnable objectthe task to have the given ManagedTaskListener associated with task, final ManagedTaskListener (optional) the taskListener)ManagedTaskListener to receive
lifecycle events notification when the task is submitted. If task
implements ManagedTask, and taskListener is not
null, the ManagedTaskListener interface methods of the
task will not be called.Returns a |
| public static Runnable | Returns: a Runnable objectthe task to have the given ManagedTaskListener associated with task, final Map<String, String> (optional) execution properties to provide additional hints
to executionProperties, final ManagedTaskListener ManagedExecutorService or ManagedScheduledExecutorService
when the task is submitted.
If task implements ManagedTask with non-empty
execution properties, the Runnable returned will contain the union
of the execution properties specified in the task and the executionProperties
argument, with the latter taking precedence if the same property key is
specified in both.
After the method is called, further changes to the Map
object will not be reflected in the Runnable returned by this method.(optional) the taskListener)ManagedTaskListener to receive
lifecycle events notification when the task is submitted. If task
implements ManagedTask, and taskListener is not
null, the ManagedTaskListener interface methods of the
task will not be called.Returns a |
| public static < the return type of the Callable V> Callable | Returns: a Callable objectthe task to have the given ManagedTaskListener associated with task, final ManagedTaskListener (optional) the taskListener)ManagedTaskListener to receive
lifecycle events notification when the task is submitted. If task
implements ManagedTask, and taskListener is not
null, the ManagedTaskListener interface methods of the
task will not be called.Returns a |
| public static < the result type of the Callable V> Callable | Returns: a Callable objectthe task to have the given ManagedTaskListener associated with task, final Map<String, String> (optional) execution properties to provide additional hints
to executionProperties, final ManagedTaskListener ManagedExecutorService or ManagedScheduledExecutorService
when the task is submitted.
If task implements ManagedTask with non-empty
execution properties, the Runnable returned will contain the union
of the execution properties specified in the task and the executionProperties
argument, with the latter taking precedence if the same property key is
specified in both.
After the method is called, further changes to the Map
object will not be reflected in the Callable returned by this method.(optional) the taskListener)ManagedTaskListener to receive
lifecycle events notification when the task is submitted. If task
implements ManagedTask, and taskListener is not
null, the ManagedTaskListener interface methods of the
task will not be called.Returns a |
| NULL_TASK_ERROR_MSG | back to summary |
|---|---|
| pack-priv static final String NULL_TASK_ERROR_MSG Error message for null tasks. | |
| ManagedExecutors | back to summary |
|---|---|
| private ManagedExecutors() Not suppose to create instances of this class. | |
| isCurrentThreadShutdown | back to summary |
|---|---|
| public static boolean isCurrentThreadShutdown() Utility method for checking the
| |
| managedTask | back to summary |
|---|---|
| public static Runnable managedTask(final Runnable task, final ManagedTaskListener taskListener) throws IllegalArgumentException Returns a Example: Runnable task = ...; ManagedTaskListener myTaskListener = ...; ManagedExecutorService executor = ...; Runnable taskWithListener = ManagedExecutors.managedTask(task, myTaskListener); executor.submit(taskWithListener);
| |
| managedTask | back to summary |
|---|---|
| public static Runnable managedTask(final Runnable task, final Map<String, String> executionProperties, final ManagedTaskListener taskListener) throws IllegalArgumentException Returns a
| |
| managedTask | back to summary |
|---|---|
| public static <V> Callable Returns a
| |
| managedTask | back to summary |
|---|---|
| public static <V> Callable Returns a
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final ManagedTask | |
| private final ManagedTaskListener |
| Access | Constructor and Description |
|---|---|
| public | Adapter(final ManagedTaskListener taskListener, final Map<String, String> executionProperties, final ManagedTask managedTask)
|
| Modifier and Type | Method and Description |
|---|---|
| public Map | getExecutionProperties()
Implements jakarta. Provides additional information to the |
| public ManagedTaskListener | getManagedTaskListener()
Implements jakarta. The |
| private Map |
| executionProperties | back to summary |
|---|---|
| private final Map<String, String> executionProperties | |
| managedTask | back to summary |
|---|---|
| private final ManagedTask managedTask | |
| taskListener | back to summary |
|---|---|
| private final ManagedTaskListener taskListener | |
| Adapter | back to summary |
|---|---|
| public Adapter(final ManagedTaskListener taskListener, final Map<String, String> executionProperties, final ManagedTask managedTask) | |
| getExecutionProperties | back to summary |
|---|---|
| public Map Implements jakarta. Doc from jakarta. Provides additional information to the Some standard property keys are defined in this class. Custom property keys may be defined but must not begin with "jakarta.enterprise.concurrent.". | |
| getManagedTaskListener | back to summary |
|---|---|
| public ManagedTaskListener getManagedTaskListener() Implements jakarta. Doc from jakarta. The
| |
| initExecutionProperties | back to summary |
|---|---|
| private Map | |
| Access | Constructor and Description |
|---|---|
| public | CallableAdapter(final Callable<V> task, final Map<String, String> executionProperties, final ManagedTaskListener taskListener)
|
| Modifier and Type | Method and Description |
|---|---|
| public V | call()
Implements java. Computes a result, or throws an exception if unable to do so. |
| task | back to summary |
|---|---|
| private final Callable<V> task | |
| CallableAdapter | back to summary |
|---|---|
| public CallableAdapter(final Callable<V> task, final Map<String, String> executionProperties, final ManagedTaskListener taskListener) | |
| call | back to summary |
|---|---|
| public V call() throws Exception Implements java. Doc from java. Computes a result, or throws an exception if unable to do so. | |
| Access | Constructor and Description |
|---|---|
| public | RunnableAdapter(final Runnable task, final Map<String, String> executionProperties, final ManagedTaskListener taskListener)
|
| Modifier and Type | Method and Description |
|---|---|
| public void |
| task | back to summary |
|---|---|
| private final Runnable task | |
| RunnableAdapter | back to summary |
|---|---|
| public RunnableAdapter(final Runnable task, final Map<String, String> executionProperties, final ManagedTaskListener taskListener) | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |