use of org.apache.deltaspike.core.api.future.Futureable in project deltaspike by apache.
the class DefaultFutureableStrategy method getOrCreatePool.
protected ExecutorService getOrCreatePool(final InvocationContext ic) {
final Method method = ic.getMethod();
ExecutorService executorService = configByMethod.get(method);
if (executorService == null) {
final AnnotatedType<?> annotatedType = beanManager.createAnnotatedType(method.getDeclaringClass());
final AnnotatedMethod<?> annotatedMethod = AnnotatedMethods.findMethod(annotatedType, method);
final Futureable methodConfig = annotatedMethod.getAnnotation(Futureable.class);
final ExecutorService instance = manager.find((methodConfig == null ? annotatedType.getAnnotation(Futureable.class) : methodConfig).value());
configByMethod.putIfAbsent(method, instance);
executorService = instance;
}
return executorService;
}
Aggregations