Package org.wildfly.jberet.services.ContextHandle

Examples of org.wildfly.jberet.services.ContextHandle.Handle


        public Future<?> submitTask(final Runnable task) {
            final ContextHandle contextHandle = createContextHandle();
            return executorService.submit(new Runnable() {
                @Override
                public void run() {
                    final Handle handle = contextHandle.setup();
                    try {
                        task.run();
                    } finally {
                        handle.tearDown();
                    }
                }
            });
        }
View Full Code Here


        public <T> Future<T> submitTask(final Runnable task, final T result) {
            final ContextHandle contextHandle = createContextHandle();
            return executorService.submit(new Runnable() {
                @Override
                public void run() {
                    final Handle handle = contextHandle.setup();
                    try {
                        task.run();
                    } finally {
                        handle.tearDown();
                    }
                }
            }, result);
        }
View Full Code Here

        public <T> Future<T> submitTask(final Callable<T> task) {
            final ContextHandle contextHandle = createContextHandle();
            return executorService.submit(new Callable<T>() {
                @Override
                public T call() throws Exception {
                    final Handle handle = contextHandle.setup();
                    try {
                        return task.call();
                    } finally {
                        handle.tearDown();
                    }
                }
            });
        }
View Full Code Here

TOP

Related Classes of org.wildfly.jberet.services.ContextHandle.Handle

Copyright © 2018 www.massapicom. 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.