
You can automatically generate a monitor-configuration.xml document through a graphical interface provided by SAP NetWeaver Developer Studio. This approach is faster and decreases the likelihood of errors compared to manually creating this XML file.
The Java EE class that will provide the monitoring data is created.
Creating a Monitor
This method should return a value of type byte, char, integer, long, Boolean or string.
The monitor type depends on the value returned by the method. More information: Types of Monitors and Their Usage
Editing a Monitor
Adding a Monitor
Deleting a Monitor
You can also delete subnodes in the monitor tree by choosing Delete Node in the Monitor Tree.
After creating or adding a monitor, you need to build the application and deploy it.
Following the monitor creation, you have to add one class that will call the registerMonitorMBean() method from the class that you selected at the beginning.
importjavax.servlet.ServletException;
/**
* Servlet implementation class for Servlet: RunningServlet
*
*/
public class TestServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
/**
*
*/
private static final long serialVersionUID = 4963419095244286716L;
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public TestServlet() {
super();
}
/* (non-Javadoc)
* @see javax.servlet.GenericServlet#init()
*/
public void init() throws ServletException {
super.init();
try {
new Test().registerMonitorMBean();
// Test is your selected class
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}