Java Reference
In-Depth Information
Three types will serve to create a good example; in practice, you could use more
notification types to add more specific notifications. With these three types
defined, let's examine the code for your new MLetNotification class (listing 10.2).
Listing 10.2
MLetNotification.java
package jmxbook.ch10;
import javax.management.*;
import java.util.*;
public class MLetNotification extends Notification
{
public static final String URL_TYPE =
"jmxbook.mletwrapper.urlAdded";
public static final String MBEAN_TYPE =
"jmxbook.mletwrapper.mbeanAdded";
public static final String ERROR_TYPE =
"jmxbook.mletwrapper.error";
private String url = null;
private Set objectInstances = null;
public MLetNotification( String type, Object source,
long sequence )
{
super( type, source, sequence );
}
public void setObjectInstances( Set oi )
{
this.objectInstances = oi;
}
public void setURL( String url )
{
this.url = url;
}
public String getURL()
{
return url;
}
public Set getObjectInstances()
{
return objectInstances;
}
}
Search WWH ::




Custom Search