Search in sources :

Example 6 with CURunnable

use of org.apache.openejb.threads.task.CURunnable in project tomee by apache.

the class ManagedExecutorServiceImpl method execute.

@Override
public void execute(final Runnable command) {
    final CURunnable wrapper = new CURunnable(command);
    delegate.execute(wrapper);
    wrapper.taskSubmitted(null, this, command);
}
Also used : CURunnable(org.apache.openejb.threads.task.CURunnable)

Example 7 with CURunnable

use of org.apache.openejb.threads.task.CURunnable in project tomee by apache.

the class ManagedScheduledExecutorServiceImpl method scheduleWithFixedDelay.

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(final Runnable command, final long initialDelay, final long delay, final TimeUnit unit) {
    final CURunnable wrapper = new CURunnable(command);
    final ScheduledFuture<?> future = delegate.scheduleWithFixedDelay(wrapper, initialDelay, delay, unit);
    wrapper.taskSubmitted(future, this, command);
    return new CUScheduleFuture<Object>(ScheduledFuture.class.cast(future), wrapper);
}
Also used : CURunnable(org.apache.openejb.threads.task.CURunnable) CUScheduleFuture(org.apache.openejb.threads.future.CUScheduleFuture) ScheduledFuture(java.util.concurrent.ScheduledFuture)

Aggregations

CURunnable (org.apache.openejb.threads.task.CURunnable)7 ScheduledFuture (java.util.concurrent.ScheduledFuture)4 CUScheduleFuture (org.apache.openejb.threads.future.CUScheduleFuture)4 Future (java.util.concurrent.Future)2 CUFuture (org.apache.openejb.threads.future.CUFuture)2 Date (java.util.Date)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 TriggerRunnable (org.apache.openejb.threads.task.TriggerRunnable)1