Package org.apache.openejb.async

Examples of org.apache.openejb.async.AsynchronousPool.invoke()


            }
            final Object securityState = stateTmp;
            final ThreadContext currentCtx = ThreadContext.getThreadContext();
            final AsynchronousPool asynchronousPool = beanContext.getModuleContext().getAppContext().getAsynchronousPool();

            return asynchronousPool.invoke(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    final Object threadState;
                    if (associate) {
                        //noinspection unchecked
View Full Code Here


            final Object securityState = stateTmp;

            final ThreadContext threadContext = ThreadContext.getThreadContext();
            final AsynchronousPool asynchronousPool = beanContext.getModuleContext().getAppContext().getAsynchronousPool();

            return asynchronousPool.invoke(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    final Object threadState;
                    if (associate) {
                        //noinspection unchecked
View Full Code Here

        if (beanContext.isAsynchronous(method)) {
            final SecurityService<?> securityService = SystemInstance.get().getComponent(SecurityService.class);
            final Object state = securityService.currentState();
            final ThreadContext currentCtx = ThreadContext.getThreadContext();
            return asynchronousPool.invoke(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    final ThreadContext oldCtx; // ensure context is the same as for the caller
                    if (currentCtx != null) {
                        oldCtx = ThreadContext.enter(new ThreadContext(currentCtx));
View Full Code Here

    protected Object businessMethod(final Class<?> interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
        final BeanContext beanContext = getBeanContext();
        final AsynchronousPool asynchronousPool = beanContext.getModuleContext().getAppContext().getAsynchronousPool();

        if (beanContext.isAsynchronous(method)) {
            return asynchronousPool.invoke(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    return synchronizedBusinessMethod(interfce, method, args);
                }
            }, method.getReturnType() == Void.TYPE);
View Full Code Here

    protected Object businessMethod(final Class<?> interfce,final  Method method,final  Object[] args, Object proxy) throws Throwable {
        final BeanContext beanContext = getBeanContext();
        final AsynchronousPool asynchronousPool = beanContext.getModuleContext().getAppContext().getAsynchronousPool();

        if (beanContext.isAsynchronous(method)) {
            return asynchronousPool.invoke(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    return synchronizedBusinessMethod(interfce, method, args);
                }
            }, method.getReturnType() == Void.TYPE);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.