I'd like to check status and start/stop deployments of a web app programatically in JBoss as 7.2.0Final. I've found that for status it can be done using MBean like that, but i don't know if it's the best way to do it:
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
ObjectName myApp= new ObjectName("jboss.as:deployment=myApp.war");
String deploymentStatus = server.getAttribute(myApp, "status").toString();
Any idea about how to start and stop deployment?