1
目前我开始一些线程,如调度程序和socketserver,如米纳通过ServletContextListerner。但是在这个tomcat之后无法正确关机。我该怎么做才能释放套接字或杀死线程。如何彻底阻止tomcat而我有套接字和线程
public class ServerListener implements ServletContextListener{
public void contextDestroyed(ServletContextEvent arg0){
//what should i do here
}
public void contextInitialized(ServletContextEvent arg0){
new Thread(new Runnable(){
public void run(){
SocketMain.main(null);
}
}).start();
new Thread(new Runnable(){
public void run(){
SccheduleMain.main(null);
}
}).start();
}
}