Corporation Server User Manual

Counters Management
B-4 Oracle Communication and Mobility Server Developer’s Guide
Managing a Diameter Application with MBeans
A Diameter Application can be managed remotely by registering the Diameter
MBeans to a JMX agent and can be monitored by using the Java JConsole program.
Registering the Diameter MBeans
A Java application using the Diameter API can publish management information by
registering instances of the DiameterStackImplMBean and
DiameterProviderImplMBean interfaced to a JMX agent. This can be done as
follows:
import javax.management.MBeanServerFactory;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import oracle.sdp.diameter.*;
// Create DiameterStack and DiameterProvider instances.
// DiameterStack myStack = ...
// DiameterProvider myProvider = ...
List srvList = MBeanServerFactory.findMBeanServer(null);
if (srvList.isEmpty() == false) {
MBeanServer server = (MBeanServer)srvList.iterator().next();
try {
ObjectName name;
name = new ObjectName(
"
oracle.sdp.diameterimpl:name=DiameterProvider
"
);
server.registerMBean(myProvider, name);
name = new ObjectName(
"
oracle.sdp.diameterimpl:name=DiameterStack
"
);
server.registerMBean(myStack, name);
}
catch (Exception e) {
// Handle register exception
// ...
}
}
Using jconsole to Monitor Diameter Applications
When you have a Diameter application running -- and provided you have registered
the MBeans as described above -- you can use the JDK's jconsole application to browse
the management characteristics of the stack and application.
Start jconsole as follows:
jconsole
Note: This code requires the JDK 1.5 or later. Previous versions do
not have the required javax.management package.
If you intend to allow remote access to the MBeans, you must define
the Java property com.sun.management.jmxremote when
running your application, as follows:
java -Dcom.sun.management.jmxremote -classpath mdiameter.jar
MyApplication