use of org.apache.openejb.threads.future.CUScheduleFuture in project tomee by apache.
the class ManagedScheduledExecutorServiceImpl method schedule.
@Override
public ScheduledFuture<?> schedule(final Runnable command, final long delay, final TimeUnit unit) {
final CURunnable wrapper = new CURunnable(command);
final ScheduledFuture<?> future = delegate.schedule(wrapper, delay, unit);
wrapper.taskSubmitted(future, this, command);
return new CUScheduleFuture<Object>(ScheduledFuture.class.cast(future), wrapper);
}
use of org.apache.openejb.threads.future.CUScheduleFuture in project tomee by apache.
the class ManagedScheduledExecutorServiceImpl method scheduleAtFixedRate.
@Override
public ScheduledFuture<?> scheduleAtFixedRate(final Runnable command, final long initialDelay, final long period, final TimeUnit unit) {
final CURunnable wrapper = new CURunnable(command);
final ScheduledFuture<?> future = delegate.scheduleAtFixedRate(wrapper, initialDelay, period, unit);
wrapper.taskSubmitted(future, this, command);
return new CUScheduleFuture<Object>(ScheduledFuture.class.cast(future), wrapper);
}
use of org.apache.openejb.threads.future.CUScheduleFuture 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);
}
Aggregations