Examples of scheduleWithFixedDelay()


Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

    }

    public void setupStaticMembershipManagement(StaticMembershipInterceptor staticMembershipInterceptor) {
        this.staticMembershipInterceptor = staticMembershipInterceptor;
        ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
        scheduler.scheduleWithFixedDelay(new MemberListSenderTask(), 5, 5, TimeUnit.SECONDS);
    }

    public void setGroupManagementAgent(GroupManagementAgent groupManagementAgent) {
        this.groupManagementAgent = groupManagementAgent;
    }
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

                Thread t = new Thread(runable, "OwbConversationCleaner-" + servletContext.getContextPath());
                t.setDaemon(true);
                return t;
            }
        });
        executorService.scheduleWithFixedDelay(new ConversationCleaner(context), delay, delay, TimeUnit.MILLISECONDS);

        ELAdaptor elAdaptor = context.getService(ELAdaptor.class);
        ELResolver resolver = elAdaptor.getOwbELResolver();
        //Application is configured as JSP
        if (context.getOpenWebBeansConfiguration().isJspApplication()) {
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

            String target = bean.increment().getNode();
            count.incrementAndGet();
            ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
            try {
                CountDownLatch latch = new CountDownLatch(1);
                Future<?> future = executor.scheduleWithFixedDelay(new IncrementTask(bean, count, latch), 0, INVOCATION_WAIT, TimeUnit.MILLISECONDS);
                latch.await();

                undeploy(this.findDeployment(target));

                future.cancel(false);
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

                }

                deploy(this.findDeployment(target));

                latch = new CountDownLatch(1);
                future = executor.scheduleWithFixedDelay(new IncrementTask(bean, count, latch), 0, INVOCATION_WAIT, TimeUnit.MILLISECONDS);
                latch.await();

                stop(this.findContainer(target));

                future.cancel(false);
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

                }

                start(this.findContainer(target));

                latch = new CountDownLatch(1);
                future = executor.scheduleWithFixedDelay(new LookupTask(directory, SlowToDestroyStatefulIncrementorBean.class, latch), 0, INVOCATION_WAIT, TimeUnit.MILLISECONDS);
                latch.await();

                undeploy(this.findDeployment(target));

                future.cancel(false);
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

                }

                deploy(this.findDeployment(target));

                latch = new CountDownLatch(1);
                future = executor.scheduleWithFixedDelay(new LookupTask(directory, SlowToDestroyStatefulIncrementorBean.class, latch), 0, INVOCATION_WAIT, TimeUnit.MILLISECONDS);
                latch.await();

                stop(this.findContainer(target));

                future.cancel(false);
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

    /**
     * Schedules a background task for flushing the index once per second.
     */
    private void scheduleFlushTask() {
        ScheduledExecutorService executor = handler.getContext().getExecutor();
        flushTask = executor.scheduleWithFixedDelay(new Runnable() {
            public void run() {
                // check if there are any indexing jobs finished
                checkIndexingQueue(false);
                // check if volatile index should be flushed
                checkFlush();
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

                final Thread t = new Thread(runable, "OwbConversationCleaner-" + servletContext.getContextPath());
                t.setDaemon(true);
                return t;
            }
        });
        executorService.scheduleWithFixedDelay(new ConversationCleaner(context), delay, delay, TimeUnit.MILLISECONDS);

        final ELAdaptor elAdaptor = context.getService(ELAdaptor.class);
        final ELResolver resolver = elAdaptor.getOwbELResolver();
        //Application is configured as JSP
        if (context.getOpenWebBeansConfiguration().isJspApplication()) {
View Full Code Here

Examples of java.util.concurrent.ScheduledExecutorService.scheduleWithFixedDelay()

    /**
     * Schedules a background task for flushing the index once per second.
     */
    private void scheduleFlushTask() {
        ScheduledExecutorService executor = handler.getContext().getExecutor();
        flushTask = executor.scheduleWithFixedDelay(new Runnable() {
            public void run() {
                // check if there are any indexing jobs finished
                checkIndexingQueue(false);
                // check if volatile index should be flushed
                checkFlush();
View Full Code Here

Examples of java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay()

            public void run() {
                executor.purge();
            }
        };
       
        executor.scheduleWithFixedDelay(task,
                PURGE, PURGE, TimeUnit.MILLISECONDS);
        return executor;
    }
   
    private static class DefaultThreadFactory implements ThreadFactory {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.