lundi 3 août 2015

Cancel TimerTask that has persisted across redeploy

I have a JavaEE application deployed to Weblogic 10.3. In my application, I created a Timer and TimerTask that started at the beginning of the application loading up by doing the following:

TimerTask t = new TimerTask() {
    @Override
    public void run() {
        // Perform task
    }
};
Timer timer = new Timer();
timer.scheduleAtFixedRate(t, 0, 15000);

The problem is, after redeploying the application, the previous timer tasks are still executing. So after 5 deployments, there are 5 timers executing. I don't have the ability to restart the Weblogic server. Is there any way to stop these tasks?

Aucun commentaire:

Enregistrer un commentaire