Yes, the second approach. You can request all needed information through either a Java or HTTP and protocol. This Wiki page explains the format of such a request (adressing, parameters, etc):
- http://community.jboss.org/wiki/FormatOfADetypedOperationRequest
General information can be found here:
- https://docs.jboss.org/author/display/AS71/Admin+Guide