java - Persisting thread after redeploy JBoss 6.1.0 -


i'm deploying ear jar in lib folder of ear. jar spawns defaultfilemonitor thread (from apache commons api) , watches file.

when use twiddle redeploy of ear, undeploy called wars doesn't seem kill defaultfilemonitor thread.

the issue keep multiple defaultfilemonitor open on same file , causing issues.

what proper way kill thread? twiddle blame here?

public enum logger {     instance;     defaultfilemonitor fm = new defaultfilemonitor(new customfilelistener());     private fileobject file = null;     private fileobject object = null;      private logger() {      this.openfile();      try {         filesystemmanager fsmanager = vfs.getmanager();         file = fsmanager.resolvefile(this.getfilelocation());         object = fsmanager.resolvefile("c:\test.txt");     } catch (filesystemexception e) {         e.printstacktrace();     }      fm.setdelay(1000);     fm.addfile(file);     fm.start(); } 

here code i'm using load defaultfilemonitor


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -