import org.jboss.mx.util.MBeanServerLocator; ... MBeanServer server = MBeanServerLocator.locateJBoss(); ObjectName target = new ObjectName("jboss.system:type=Server"); server.invoke(target, "shutdown", new Object, new String);
Thanks . Its working..
I am having two instances of JBOSS Namely instance1,instance2 running on my machine How to shutdown a particular instance. Could anyone Plz help out. Using the above code, the default instance is getting shutdown. But i need to shutdown either of the instances based on the user request.
Thanks in advance