The DynamicJMX component represents a way to talk to an JMX (Java Management eXtensions) MBean server, whether local or remote.
To instantiate DynamicJMX, you pass to the constructor the name of an external resource (of type JMX) of your project.
DynamicJMX provides a simplified interface to operate with JMX services dynamically. As an alternative to DynamicJMX, Oracle BPM Studio provides a way to catalog JMX services into your project. Cataloging a service creates Oracle BPM objects for each MBean type, providing a static interface with compile-time checking.
// Instantiate DynamicJMX and display default domain name
jmxExtResource as String
jmxExtResource = "jmxConfig"
dynamicJMX as Fuego.Jmx.DynamicJMX
dynamicJMX = Fuego.Jmx.DynamicJMX(configuration : jmxExtResource)
display dynamicJMX.getDefaultDomain()
// Invoke the "gc" (Garbage Collection) operation on
// "java.lang:type=Memory" bean
objectName = Fuego.Jmx.ObjectName(canonicalName :
"java.lang:type=Memory")
operation = Fuego.Jmx.Operation(name : "gc")
display( invokeOperation(dynamicJMX, objectName : objectName,
operation : operation, parameters : []))
// Get additional information about the bean
info = dynamicJMX.getMBeanInfo(name : objectName)
display(info.className)
display info.description
display info.notificationTypes
// Iterate over the attributes of the bean
for each attribute in info.attributes do
display attribute.name
end
// Get the value of the "HeapMemoryUsage" attribute
heapAttribute = Fuego.Jmx.Attribute(name : "HeapMemoryUsage")
heapValue = getAttribute(dynamicJMX, objectName : objectName, attribute : heapAttribute)
display heapValue
// Iterate over the operations provided by this bean
for each operation in info.operations do
display operation.name
end