|
From: Russell B. <rb...@po...> - 2005-10-11 13:33:09
|
Sorry, I reposted the message because I actually sent it before I approved my subscription and I got an error email. The application I made some more changes last night and it now works as follows. I have a Service.class which is called by the wrapper. That starts a MonitorService thread, which then runs the actual FeedMonitor every 15 minutes. So is it stupid to have a thread running a thread that starts a new thread every 15 minutes, just to avoid a bunch of base db hits and processing every 15 minutes... I'm starting to think so, but it was at least a good practice in futility. Is what I have no correct or a bastardization of Java and the Wrapper in general? Thanks Russ -----Original Message----- From: wra...@li... [mailto:wra...@li...] On Behalf Of Leif Mortenson Sent: Monday, October 10, 2005 6:31 PM To: wra...@li... Subject: Re: [Wrapper-user] Service starts, app runs once, then shutdowns? Russell, The restart functions are really only designed to restart a JVM which "fails" in any one of a number of ways. It sounds like in your case, the Java application is completing without problems and exiting normally. The Wrapper is handling this correctly by exiting. Is there a reason why you don't just create a thread within your JVM that runs an operation every 15 minutes? This way the JVM stays up. That would have the disadvantage of having the JVM take up memory while it is idle... One way that you could make this work is to add the following configuration properties to your wrapper.conf file. wrapper.on_exit.0=RESTART wrapper.restart.delay=900 See the following: http://wrapper.tanukisoftware.org/doc/english/prop-on-exit-n.html http://wrapper.tanukisoftware.org/doc/english/prop-restart-delay.html That should override the default shutdown behavior and queue up a restart when the JVM exits normally. Let me know how this works as I didn't actually try it just now... You might want to use a different exit code to trigger the restart so you have a way to actually cause the cycle to stop. Use System.exit(1) or something. Cheers, Leif |