@Singleton public class DefaultExecutorSelector extends java.lang.Object implements ExecutorSelector
ExecutorSelector
interface that regards methods that return reactive types as non-blocking.Modifier | Constructor and Description |
---|---|
protected |
DefaultExecutorSelector(BeanLocator beanLocator,
javax.inject.Provider<java.util.concurrent.ExecutorService> ioExecutor)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.util.concurrent.ExecutorService> |
select(MethodReference method,
ThreadSelection threadSelection)
Select an
ExecutorService for the given MethodReference . |
protected DefaultExecutorSelector(BeanLocator beanLocator, @Named(value="io") javax.inject.Provider<java.util.concurrent.ExecutorService> ioExecutor)
beanLocator
- The bean locatorioExecutor
- The IO executorpublic java.util.Optional<java.util.concurrent.ExecutorService> select(MethodReference method, ThreadSelection threadSelection)
ExecutorSelector
ExecutorService
for the given MethodReference
.select
in interface ExecutorSelector
method
- The MethodReference
threadSelection
- The thread selection modeExecutorService
. If an ExecutorService
cannot be established
Optional.empty()
is returned