Re: [Simpleweb-Support] Shutdown
Brought to you by:
niallg
From: Niall G. <ni...@em...> - 2004-05-05 18:24:45
|
Hi, Closing the socket with ServerSocket.close() will terminate all connection threads for that socket, however this will still leave active poller threads within the PipelineProcessor active. I have to admit that this has been overlooked, however you can extend the PipelineProcessor and terminate all threads within the Vector named active which contains all active Poller threads. Really the PiplineProcessor threads should be daemon threads as of Thread.setDaemon(true), ill make sure to include this fix in the next release. Regards Niall ----- Original Message ----- From: "Lars Arvidson" Date: Wed, 5 May 2004 19:21:48 +0200 To: Subject: [Simpleweb-Support] Shutdown Hi! 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. public static void main(String[] args) throws Exception { LoaderEngine engine = new LoaderEngine(); engine.load("default", "test.MainService"); engine.link("*", "default"); ProtocolHandler handler = HandlerFactory.getInstance(engine); Connection connection = ConnectionFactory.getConnection(handler); ServerSocket socket = new ServerSocket(8282); connection.connect(socket); Thread.sleep(1000); socket.close(); } This did not terminate the application. I also tied with ProcessQueue.getInstance().stop(). 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? /Lars -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |