Hi
I have application which is developed in java. In that application
I want to find out is it trying to load 2nd time or 1st time.
example
1st
java testapp
---- this time it should work and I will not come out of
---- application it is running still...
2nd
java testapp
--- This time it should check and say application already
running. Is
that any way to do this?
Discussions
EJB programming & troubleshooting: want to find that the java application is already executing
-
want to find that the java application is already executing (3 messages)
- Posted by: G Manikandan
- Posted on: January 17 2003 14:38 EST
Threaded Messages (3)
- want to find that the java application is already executing by A J2EE Maniac on January 17 2003 14:54 EST
- want to find that the java application is already executing by Gal Binyamini on January 17 2003 16:20 EST
- want to find that the java application is already executing by G Manikandan on January 18 2003 02:02 EST
-
want to find that the java application is already executing[ Go to top ]
- Posted by: A J2EE Maniac
- Posted on: January 17 2003 14:54 EST
- in response to G Manikandan
i dint get your question dude.
are you willing to try this stuff at the jvm / system level or application level.. ???? -
want to find that the java application is already executing[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: January 17 2003 16:20 EST
- in response to G Manikandan
One simple way to do this is to open a socket on some predefined port (make it high and meaningless so the chances somebody else will use it are small). When your application loads, open this port if it is not allready open. If it is, then you know the application is allready running.
You can also do the same with some predefined file (create on load, delete on exit), but if your application crashes the file may remain undeleted so you need some sort of crash-detection mechanism. One option would be to update the file every second or so with the current date.
Gal -
want to find that the java application is already executing[ Go to top ]
- Posted by: G Manikandan
- Posted on: January 18 2003 02:02 EST
- in response to G Manikandan
hi
i want this system level.i ensure while starting second time that the application is already executing or not