RE: [Simpleweb-Support] Shutdown
Brought to you by:
niallg
From: Lars A. <la...@un...> - 2004-05-06 07:42:08
|
Hi, Thanks for the quick reply. To get it to work I had to put setDaemon(true) in following locations: * Constructor of CacheCleaner, Daemon and simple.http.load.Processor. * Init function of PipelineProcessor witch creates simple.http.Processor = threads. To terminate the application: socket.close(); UnicastRemoteObject.unexportObject(engine, true); This should be ok? /Lars -----Original Message----- From: Niall Gallagher [mailto:ni...@em...]=20 Sent: den 5 maj 2004 20:25 To: sim...@li... Subject: Re: [Simpleweb-Support] Shutdown 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"=20 Date: Wed, 5 May 2004 19:21:48 +0200 To:=20 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. =A0=A0=A0=A0=A0 public static void main(String[] args) throws Exception = { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 LoaderEngine engine =3D new = LoaderEngine(); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 engine.load("default", = "test.MainService"); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 engine.link("*", "default"); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ProtocolHandler handler =3D = HandlerFactory.getInstance(engine); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Connection connection =3D = ConnectionFactory.getConnection(handler); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ServerSocket socket =3D new = ServerSocket(8282); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 connection.connect(socket); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Thread.sleep(1000); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 socket.close(); =A0=A0=A0=A0=A0 } 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=20 --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to=20 deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=3Dosdnemail3 _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |