Java Reference
In-Depth Information
and read the response. Then, we are connecting to the local WildFly instance and issuing a
:jndi-view command.
The connect command can be used to connect to a remote WildFly host as well by
adding the following parameters: connect (String controllerHost, int
controllerPort, String username, String password) .
The response variable is org.jboss.dmr.ModelNode . This can be further inspected
as shown in the following example, which goes in to some depth about platform MBeans,
to get some memory statistics:
from import CLI
cli = CLI.newInstance()
cli.cmd("cd /core-service=platform-mbean/type=memory/")
result =
response = result.getResponse()
enabled = response.get("result").get("heap-memory-usage")
used = enabled.get("used").asInt()
if used > 512000000:
print "Over 1/2 Gb Memory usage "
print 'Low usage!'
In the previous example, we tracked the resources contained in /core-
service=platform-mbean/type=memory . The available resources are, however,
child resources of the two kinds of available heap memory areas ( heap-memory-us-
age and non-heap-memory-usage ), as shown by the following code:
Search WWH ::

Custom Search