wood burning stoves 2.0*
The moose likes Java in General and the fly likes Making java Daemons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Making java Daemons " Watch "Making java Daemons " New topic
Author

Making java Daemons

hennie louw
Ranch Hand

Joined: Jul 03, 2001
Posts: 56
Hi All
I have been developing at few server side apps in java and would just like to know if there is any way
of starting an java application in a background process... (I have been able to do this with the process object ) but how can I invoke the app's shutdown procedure from the console??
A good exsample of this is the Tomcat JSP container.
it starts as a background process and even in windows
it does not have any dos prompt windows hanging around.
Any advice on this would be great


Any Body can be paid to write good code, but brilliant code can only come from passion
Blake Minghelli
Ranch Hand

Joined: Sep 13, 2002
Posts: 331
All of our java apps run as daemons. We shut them down by creating a shutdown file (just a 0-byte file in a specified directory). Our apps are coded so that they periodically monitor for the existence of a shutdown file, and if they find one, then they know they need to shutdown.
Hope that helps.


Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
hennie louw
Ranch Hand

Joined: Jul 03, 2001
Posts: 56
Originally posted by Blake Minghelli:
All of our java apps run as daemons. We shut them down by creating a shutdown file (just a 0-byte file in a specified directory). Our apps are coded so that they periodically monitor for the existence of a shutdown file, and if they find one, then they know they need to shutdown.
Hope that helps.

At the current moment my systems also work in the way , but I am wondering if this is not causing I/O calls to the OS that will bring down performance
Blake Minghelli
Ranch Hand

Joined: Sep 13, 2002
Posts: 331
It is something to consider. Every project has its own performance requirements. For us, the strategy works fine and the performance hit for each check is negligible.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Making java Daemons
 
Similar Threads
Detecting Key Presses in Windows (without focus)
Detecting Key Presses in Windows (without focus)
heap size vs memory usage
uploading OS/390 datasets
java application as windows service - how?