When I am starting the application at that time i am storing a reference of Manager(main) class in a static field. Now while stopping the deamon. I have accessing the same instance of Manager class and calling shutdown method on same.
Now this is fine when both the execution(start/stop) are in same JVM but by default, eclipse stars a new jvm on each execution of main class.
So any one has any idea how to change this default behavior, so that both the execution are in same JVM.
thanks in advance.
SCJP 5, SCDJWS<br /> <br />It's amazing how premature optimisation is both seductive and destructive; even when you know
No, that's not possible - neither inside nor outside of Eclipse. It's just not how the JVM works.
A typical way of solving this problem is having the main application listen to a port and having the shutdown command sending a special string to that port, so that the main application knows that it should shut down.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Swapnil, As Ilja rightly mentioned, Java provides no standard (predefined) way of doing Inter Process communication - which is what you require. Common methods of achieving inter process communication include, sockets (most preferred), RMI, CORBA, locking files (least preferred).
I am pasting some links which can give your more insight into which method would be the best for your case: