Interface ExecutorSelector
- All Known Implementing Classes:
DefaultExecutorSelector
public interface ExecutorSelector
Interface that allows customizing the selection of the
ExecutorService to run an operation on.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptionselect(@Nullable MethodReference<?, ?> method, ThreadSelection threadSelection) Select anExecutorServicefor the givenMethodReference.Obtain executor for the given name.default ExecutorselectExecutor(@Nullable MethodReference<?, ?> method, ThreadSelectionConfiguration configuration) Select anExecutorfor the givenMethodReference.
-
Method Details
-
select
Optional<ExecutorService> select(@Nullable MethodReference<?, ?> method, ThreadSelection threadSelection) Select anExecutorServicefor the givenMethodReference.- Parameters:
method- TheMethodReferencethreadSelection- The thread selection mode- Returns:
- An optional
ExecutorService. If anExecutorServicecannot be establishedOptional.empty()is returned
-
select
Obtain executor for the given name.- Parameters:
name- The name of the executor- Returns:
- An executor if it exists
- Since:
- 3.1.0
-
selectExecutor
default Executor selectExecutor(@Nullable MethodReference<?, ?> method, ThreadSelectionConfiguration configuration) Select anExecutorfor the givenMethodReference.- Parameters:
method- TheMethodReferenceconfiguration- The thread selection configuration- Returns:
- An optional
Executor. If anExecutorcannot be established, anImmediateExecutoris returned.
-