Package org.apache.openejb.concurrencyutilities.ee.task

Examples of org.apache.openejb.concurrencyutilities.ee.task.CURunnable


        return new CUFuture<T>(future, wrapper);
    }

    @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<T>(future, wrapper);
    }
View Full Code Here


        return new CUFuture<T>(future, wrapper);
    }

    @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<Void>(Future.class.cast(future), wrapper);
    }
View Full Code Here

        return new CUFuture<Void>(Future.class.cast(future), wrapper);
    }

    @Override
    public void execute(final Runnable command) {
        final CURunnable wrapper = new CURunnable(command);
        delegate.execute(wrapper);
        wrapper.taskSubmitted(null, this, command);
    }
View Full Code Here

    @Override
    public ScheduledFuture<?> schedule(final Runnable runnable, final Trigger trigger) {
        final Date taskScheduledTime = new Date();
        final AtomicReference<Future<?>> futureHandle = new AtomicReference<Future<?>>();
        final TriggerRunnable wrapper = new TriggerRunnable(this, runnable, new CURunnable(runnable), trigger, taskScheduledTime, getTaskId(runnable), AtomicReference.class.cast(futureHandle));
        final ScheduledFuture<?> future = delegate.schedule(wrapper, trigger.getNextRunTime(wrapper.getLastExecution(), taskScheduledTime).getTime() - nowMs(), TimeUnit.MILLISECONDS);
        return initTriggerScheduledFuture(runnable, AtomicReference.class.cast(futureHandle), wrapper, ScheduledFuture.class.cast(future));
    }
View Full Code Here

        return new CUScheduleFuture<V>(ScheduledFutureFacade.<V>newProxy(futureHandle), wrapper);
    }

    @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);
    }
View Full Code Here

        return new CUScheduleFuture<V>(future, wrapper);
    }

    @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);
    }
View Full Code Here

        return new CUScheduleFuture<Object>(ScheduledFuture.class.cast(future), wrapper);
    }

    @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);
    }
View Full Code Here

        return new CUFuture<T>(future, wrapper);
    }

    @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<T>(future, wrapper);
    }
View Full Code Here

        return new CUFuture<T>(future, wrapper);
    }

    @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<Void>(CUFuture.class.cast(future), wrapper);
    }
View Full Code Here

        return new CUFuture<Void>(CUFuture.class.cast(future), wrapper);
    }

    @Override
    public void execute(final Runnable command) {
        final CURunnable wrapper = new CURunnable(command);
        delegate.execute(wrapper);
        wrapper.taskSubmitted(null, this, command);
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.concurrencyutilities.ee.task.CURunnable

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.