The JBoss AS 7 provide different management interfaces. All the management interfaces based on the Detyped Management representation (jboss-dmr).
You can implemet a custom Java client with the jboss-dmr library and the jboss-as-controller-client. For an example, see our github repository.
To get information about the JVM and other stuff, you need to implement the following operation:
ModelNode operation = new ModelNode();
operation.get("operation").set("read-resource");
operation.get("recursive").set(true);
operation.get("include-runtime").set(true);
ModelNode address = operation.get("address");
address.add("core-service", "platform-mbean");
Alternatively, you can also use the PlatformMBeanServer:
//Get a connection to the JBoss AS MBean server on localhost
String host = "localhost";
int port = 9999; // management-native port
String urlString = "service:jmx:remoting-jmx://" + host + ":" + port;
JMXServiceURL serviceURL = new JMXServiceURL(urlString);
JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, null);
MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();
//Invoke on the JBoss AS MBean server
connection.getObjectInstance(new ObjectName("java.lang:type=Threading"));
//...
jmxConnector.close();