Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Making java Daemons

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
hennie louw
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic