I want to write a java program that checks the status of a particular service (whether its running or not). If service is not running then i want to run that service. Is it possible in java? If so, please guide me with where to start with. Any api or links will be greatly appreciated.
Services written by you? If yes, write/run them as threads, and check if the thread has terminated or not (like serviceThread == Thread.State.TERMINATED.)
Thanks for your reply. I am working on linux. I have one c++ program which i wrote, i am running this as a service. Now i want to write a java program that checks whether is service is up or down. If service is down, then i want to restart this service. Now as per your reply, i didnt understand your reply. how to create a service thread?
You can use Java to "talk" JNI to a custom C++ module which can then do anything C++ can do on your system. It won't be portable to Windows of course but you may be lucky enough to not care.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi