Java Reference
In-Depth Information
public String getString()
{
return string;
}
public void setString( String value )
{
string = value;
}
public Float getGauge()
{
return gauge;
}
public void setGauge( Float value )
{
gauge = value;
}
public Integer getCounter()
{
return counter;
}
public void setCounter( Integer value )
{
counter = value;
}
}
All changes to the MBean's attribute take place via the HTML adapter. Once you
have the agent created and running, you will alter the values of this target MBean
and watch the different types of notifications that are received from the monitors.
The next thing you need to do is write the MonitoringSetup class. Recall that
this class will register your target MBean and an MBean for each type of monitor
MBean. In addition, this simple program will remain active to act as a notifica-
tion listener to the monitors. Listing 12.2 shows the MonitoringSetup class.
Listing 12.2
MonitoringSetup.java
package jmxbook.ch12;
import jmxbook.ch3.*;
import javax.management.*;
import javax.management.monitor.*;
import com.sun.jdmk.comm.*;
public class MonitoringSetup implements NotificationListener
Search WWH ::




Custom Search