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.
---- this time it should work and I will not come out of
---- application it is running still...
--- This time it should check and say application already
that any way to do this?
i dint get your question dude.
are you willing to try this stuff at the jvm / system level or application level.. ????
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.
i want this system level.i ensure while starting second time that the application is already executing or not