I am trying to implement some simple monitoring using the DMR API, so far I can list all the datasources and then get for each one some statistics with the following cli expression [/subsystem=datasources:read-resource(recursive=true)] translated to Java:
ModelNode request = new ModelNode();
ModelNode op = request.get(ClientConstants.OP);
op.set(ClientConstants.READ_RESOURCE_OPERATION);
request.get(ClientConstants.RECURSIVE).set(true);
ModelNode address = request.get(ClientConstants.OP_ADDR);
address.add(ClientConstants.SUBSYSTEM, "datasources");
final ModelNode response = verify(client.execute(new OperationBuilder(request).build()));
List<ModelNode> list = response.get(ClientConstants.RESULT).get("data-source").asList();
for (ModelNode node : list) {
String dsName = node.keys().iterator().next();
//...Check for each ds using the cli expression
//[/subsystem=datasources/data-source=dsName/statistics=pool:read-resource(recursive=true, include-runtime=true)]
}
But if I try to do the same for ejb3 using the cli expression [/subsystem=ejb3:read-resource(recursive=true)] I don't get a list of ejb3 but something different.
I know I can get what I am looking for if I already know the name of the app and its mdb with the cli expression [/deployment=App.war/subsystem=ejb3/message-driven-bean=Consumer:read-resource(include-runtime=true)] but I have many so I don't want to include a list of them.
Any expert out there that could help me?
Thanks!
Johann