[Simpleweb-Support] Shutdown
Brought to you by:
niallg
From: Lars A. <la...@un...> - 2004-05-05 17:21:51
|
Hi! =20 I tried the code in the getting started tutorial and added a .close() on the socket hoping it would terminate all threads and make the test application exit. =20 public static void main(String[] args) throws Exception { LoaderEngine engine =3D new LoaderEngine(); engine.load("default", "test.MainService"); engine.link("*", "default"); ProtocolHandler handler =3D HandlerFactory.getInstance(engine); Connection connection =3D ConnectionFactory.getConnection(handler); ServerSocket socket =3D new ServerSocket(8282); connection.connect(socket); Thread.sleep(1000); socket.close(); } =20 This did not terminate the application. I also tied with ProcessQueue.getInstance().stop(). =20 The only way I found to terminate the application was System.exit(). Is there another way to terminate the worker threads? What is the recommended approach to terminate the application? =20 /Lars=20 |