Is a periodic task created by EE concurrency utilities automatically cancelled during undeployment?

Solution Unverified - Updated -


Periodic tasks created by javax.enterprise.concurrent.ManagedScheduledExecutorService like the following code are not canceled on undeployment. Is there any workaround?

public class ScheduledTaskAssigner {
    ManagedScheduledExecutorService scheduler;

    public void newPeriodicTask() {
        ScheduledFuture<?> future = scheduler.scheduleWithFixedDelay(() -> {
            System.out.println("### run periodic task");
        }, 0, 1, TimeUnit.SECONDS);


  • Red Hat Enterprise Application Platform (JBoss EAP)
    • 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content