Package javax.enterprise.concurrent

Examples of javax.enterprise.concurrent.Trigger


        final ManagedScheduledExecutorService es = new ManagedScheduledExecutorServiceImplFactory().create();
        final CountDownLatch counter = new CountDownLatch(5);
        final FutureAwareCallable callable = new FutureAwareCallable(counter);

        final ScheduledFuture<?> future = es.schedule(Runnable.class.cast(callable),
            new Trigger() {
                @Override
                public Date getNextRunTime(final LastExecution lastExecutionInfo, final Date taskScheduledTime) {
                    if (lastExecutionInfo == null) {
                        return new Date();
                    }
View Full Code Here


        final ManagedScheduledExecutorService es = new ManagedScheduledExecutorServiceImplFactory().create();
        final CountDownLatch counter = new CountDownLatch(5);
        final FutureAwareCallable callable = new FutureAwareCallable(counter);

        final Future<Long> future = es.schedule((Callable<Long>) callable,
            new Trigger() {
                @Override
                public Date getNextRunTime(final LastExecution lastExecutionInfo, final Date taskScheduledTime) {
                    if (lastExecutionInfo == null) {
                        return new Date();
                    }
View Full Code Here

        final ManagedScheduledExecutorService es = new ManagedScheduledExecutorServiceImplFactory().create();
        final CountDownLatch counter = new CountDownLatch(5);
        final FutureAwareCallable callable = new FutureAwareCallable(counter);

        final ScheduledFuture<?> future = es.schedule(Runnable.class.cast(callable),
            new Trigger() {
                @Override
                public Date getNextRunTime(final LastExecution lastExecutionInfo, final Date taskScheduledTime) {
                    if (lastExecutionInfo == null) {
                        return new Date();
                    }
View Full Code Here

        final ManagedScheduledExecutorService es = new ManagedScheduledExecutorServiceImplFactory().create();
        final AtomicInteger counter = new AtomicInteger(0);
        final FutureAwareCallable callable = new FutureAwareCallable(counter);

        final Future<Integer> future = es.schedule((Callable<Integer>) callable,
                new Trigger() {
                    @Override
                    public Date getNextRunTime(LastExecution lastExecutionInfo, Date taskScheduledTime) {
                        if (lastExecutionInfo == null) {
                            return new Date();
                        }
View Full Code Here

        final ManagedScheduledExecutorService es = new ManagedScheduledExecutorServiceImplFactory().create();
        final AtomicInteger counter = new AtomicInteger(0);
        final FutureAwareCallable callable = new FutureAwareCallable(counter);

        final ScheduledFuture<?> future = es.schedule(Runnable.class.cast(callable),
                new Trigger() {
                    @Override
                    public Date getNextRunTime(LastExecution lastExecutionInfo, Date taskScheduledTime) {
                        if (lastExecutionInfo == null) {
                            return new Date();
                        }
View Full Code Here

    @Resource
    private ManagedScheduledExecutorService executor;

    @Override
    public void runJob() {
        executor.schedule(createJob(), new Trigger() {

            @Override
            public Date getNextRunTime(LastExecution lastExecutionInfo, Date taskScheduledTime) {
                if (MyJob.executedBatchs.size() >= 3) {
                    return null;
View Full Code Here

TOP

Related Classes of javax.enterprise.concurrent.Trigger

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.