/* JFox, the OpenSource J2EE Application Server
*
* Copyright (C) 2002 huihoo.org
* Distributable under GNU LGPL license
* See the GNU Lesser General Public License for more details.
*/
package example.jmx.notification;
import javax.management.AttributeChangeNotification;
import javax.management.NotificationBroadcasterSupport;
/**
*
* @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
*/
public class SimpleNotification extends NotificationBroadcasterSupport implements SimpleNotificationMBean {
private String word;
public SimpleNotification(String word) {
this.word = word;
}
public String getWord() {
return word;
}
public void setWord(String _word) {
Object old = word;
word = _word;
/*
* send notification
*/
AttributeChangeNotification notify = new AttributeChangeNotification(this,System.currentTimeMillis(),System.currentTimeMillis(),"Word Changed","word","java.lang.String",old,word);
this.sendNotification(notify);
}
public void printWord() {
System.out.println(word);
}
public void setString(String s){
}
}
|