Is there any way to call a certain method in a running java application?
Forexample: I have a java application running, Now I want to call a method uk.co.planetbeyond.chatservice.Stopper.stop() on the same instance of the application. Can I do that?
The easiest way to do this is using JMX. You just have to expose methods you want to call to MBean. Then you can use any JMX client you want to call the methods. You can either use JConsole that is a part of your JDK or create your own command line application.
There is also command line JMX client.