aspose file tools*
The moose likes JSP and the fly likes How to know that application is already running? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to know that application is already running?" Watch "How to know that application is already running?" New topic
Author

How to know that application is already running?

Madeswaran Pachiyappan
Greenhorn

Joined: Jun 29, 2004
Posts: 7
Hi,
I successfully invoked some exe application through JSP.Using Runtime Class.Now,the Problem is ...
I want to know,whether the application is already invoked by other User.
if so,i want to through some message to current invoker.
pls,.It's very urgent...help me...


Madeswaran P,<br />Chennai,<br />TamilNadu.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You'd have to interogate the OS to find out what processes are running - which could be easily enough done on UNIX (ps -e | grep -e <whatever> or something) and less easily done with Windows/MacOS. You'll probably be able to access running process with some native code on Windows. But neither way is particularaly robust - you need to know that your process will have a unique name on the OS, which it might not. A better way perhaps would be to launch the process from a singleton - that way (assuming it starts) your app would know that it had already started the process.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
Consider Paul's rocket mass heater.
 
subject: How to know that application is already running?