Search in sources :

Example 1 with CUFuture

use of org.apache.openejb.threads.future.CUFuture in project tomee by apache.

the class ManagedExecutorServiceImpl method submit.

@Override
public <T> Future<T> submit(final Runnable task, final T result) {
    final CURunnable wrapper = new CURunnable(task);
    final Future<T> future = delegate.submit(wrapper, result);
    wrapper.taskSubmitted(future, this, task);
    return new CUFuture<>(future, wrapper);
}
Also used : CURunnable(org.apache.openejb.threads.task.CURunnable) CUFuture(org.apache.openejb.threads.future.CUFuture)

Example 2 with CUFuture

use of org.apache.openejb.threads.future.CUFuture in project tomee by apache.

the class ManagedExecutorServiceImpl method submit.

@Override
public Future<?> submit(final Runnable task) {
    final CURunnable wrapper = new CURunnable(task);
    final Future<?> future = delegate.submit(wrapper);
    wrapper.taskSubmitted(future, this, task);
    return new CUFuture<>(Future.class.cast(future), wrapper);
}
Also used : CURunnable(org.apache.openejb.threads.task.CURunnable) Future(java.util.concurrent.Future) CUFuture(org.apache.openejb.threads.future.CUFuture) CUFuture(org.apache.openejb.threads.future.CUFuture)

Aggregations

CUFuture (org.apache.openejb.threads.future.CUFuture)2 CURunnable (org.apache.openejb.threads.task.CURunnable)2 Future (java.util.concurrent.Future)1