Java Reference
In-Depth Information
Reading management model descriptions via the
raw management API
Using the detyped management API is not too different from its scripting language coun-
terpart; at first, you need to create a management client that can connect to your target pro-
cess's native management socket (which can be an individual standalone mode server, or in
a domain mode environment, the domain controller):
ModelControllerClient client =
ModelControllerClient.Factory.create(InetAddress.getByName("localhost"),
9990);
Next, you need to create an operation request object using the
org.jboss.dmr.ModelNode class, as shown in the following command:
final ModelNode operation = new ModelNode();
operation.get("operation").set("jndi-view");
final ModelNode address = operation.get("address");
address.add("subsystem", "naming");
operation.get("recursive").set(true);
operation.get("operations").set(true);
final ModelNode returnVal = client.execute(operation);
logger.info(returnVal.get("result").toString());
As you can see, ModelNode objects can be chained in order to reach an operation (in the
example, the JNDI view), which is available on a node path (in our case, the naming sub-
system).
Once you have added the ModelNode attributes, you can issue the execute commands
on your node, which will in turn return ModelNode where the result of the operation will
be stored.
In the samples, you can find a fully working project containing these management ex-
amples.
Search WWH ::




Custom Search