use of org.apache.openejb.threads.task.CUCallable in project tomee by apache.
the class EjbHomeProxyHandler method homeMethod.
/*-------------------------------------------------*/
/* Home interface methods */
/*-------------------------------------------------*/
protected Object homeMethod(final Class interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
checkAuthorization(method);
final BeanContext beanContext = getBeanContext();
if (beanContext.isAsynchronous(method)) {
return beanContext.getModuleContext().getAppContext().getAsynchronousPool().invoke(new CUCallable<Object>(new Callable<Object>() {
@Override
public Object call() throws Exception {
try {
return homeMethodInvoke(interfce, method, args);
} catch (final ApplicationException ae) {
logger.error("EjbHomeProxyHandler: Asynchronous call to '" + interfce.getSimpleName() + "' on '" + method.getName() + "' failed", ae);
throw ae;
}
}
}), method.getReturnType() == Void.TYPE);
} else {
return homeMethodInvoke(interfce, method, args);
}
}
Aggregations