I found this solution useful for querying deployed applications offline using the CLI api.
CLI Request:
/deployment=*:read-attribute(name=name)
where the address "/ deployment = *" will target all deployments. And basically it asks for a name attribute for all deployments on the current server.
Finally, this code snippet shows how to execute a request using the api model controller:
ModelControllerClient client = "...create the controller client";
ModelNode operation = new ModelNode( );
operation.get( "address" ).add( "deployment", "*" );
operation.get( "operation" ).set( "read-attribute" );
operation.get( "name" ).set( "name" );
ModelNode result = client.execute( operation );
List<ModelNode> deployments = result.get( "result" ).asList();
String deploymentName;
for ( ModelNode deployment : deployments ) {
deploymentName = deployment.get( "result" ).asString();
System.out.println( "deploymentName = " + deploymentName );
}
Works for both WF10 and EAP7