public boolean wasCancelCalled() { final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext di = threadContext.getBeanContext(); final Method runningMethod = threadContext.get(Method.class); if (di.isAsynchronous(runningMethod)) { if (runningMethod.getReturnType() == void.class) { throw new IllegalStateException("Current running method " + runningMethod.getName() + " is an asynchronous method, but its return type is void :" + di.getDestinationId()); } return ThreadContext.isAsynchronousCancelled(); } throw new IllegalStateException("Current running method " + runningMethod.getName() + " is not an asynchronous method :" + di.getDestinationId()); }
public boolean wasCancelCalled() { final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext di = threadContext.getBeanContext(); final Method runningMethod = threadContext.get(Method.class); if (runningMethod == null) { throw new IllegalStateException("No running method"); } if (di.isAsynchronous(runningMethod)) { if (runningMethod.getReturnType() == void.class) { throw new IllegalStateException("Current running method " + runningMethod.getName() + " is an asynchronous method, but its return type is void :" + di.getDestinationId()); } return ThreadContext.isAsynchronousCancelled(); } throw new IllegalStateException("Current running method " + runningMethod.getName() + " is not an asynchronous method :" + di.getDestinationId()); }
protected Object businessMethod(final Class<?> interfce, final Method method, final Object[] args, final Object proxy) throws Throwable { 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 synchronizedBusinessMethod(interfce, method, args); } catch (final ApplicationException ae) { logger.error("EjbObjectProxyHandler: Asynchronous call to '" + interfce.getSimpleName() + "' on '" + method.getName() + "' failed", ae); throw ae; } } }), method.getReturnType() == Void.TYPE); } else { return synchronizedBusinessMethod(interfce, method, args); } }
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); } }
if (getBeanContext().isAsynchronous(method) || getBeanContext().getComponentType().equals(BeanType.MANAGED)) { strategy = NONE;
if (getBeanContext().isAsynchronous(method) || getBeanContext().getComponentType().equals(BeanType.MANAGED)) { strategy = IntraVmCopyMonitor.State.NONE;
final boolean asynchronous = beanContext.isAsynchronous(req.getMethodInstance()); try { if (asynchronous) {
if (beanContext.isAsynchronous(method)) {
protected Object businessMethod(final Class<?> interfce, final Method method, final Object[] args, final Object proxy) throws Throwable { final BeanContext beanContext = getBeanContext(); if (beanContext.isAsynchronous(method)) {