Re: NPE caught in handleClientEvent in latest cvs-version
Leo Mekenkamp <[email protected]> Sun, 22 Aug 2004 21:29:32 +0200
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Message-ID | <1093202972.3523.16.camel@jupiter> |
On Sun, 2004-08-22 at 19:01, Wieslaw Faruga wrote: > Hi, > > W liĆcie z nie, 22-08-2004, godz. 17:38, Leo Mekenkamp pisze: > > We've been working concurrently on this: your solution did have some > > problems when (in the future) working with multiple Server instances, so > > I have been so bold as to override with my solution. > > > > Could you explain the problem with multiple server instances and my > solution? > IMHO if we have multiple server instances in the same JVM we must > shutdown all these instances because the kill signal stops JVM and > everything that works in it. Possible memory leaks: static collection in which server instances only are added; the Server class would need more public functions (instead of one run() method) to remove unneeded instances from that collection. The shutdown hook was never removed, even if there were no active servers running. Also, the sleep(500) is extremely ugly and might introduce errors when shutting down takes longer than those 500 msec. A shutdown hook now ends right after the server has stopped, leading to faster return of the command prompt. Each server instance now has its own shutdown hook, which is better OO design; a JVM can handle a large number of shutdown hooks. Cheers, Leo -- Leo Mekenkamp; phone: +31 641234919 Care about freedom and innovation? http://openoffice.org, http://ozone-db.org, http://mozilla.org, http://linux.org ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285