SimpleNotification.java :  » JMX » jfoxmx » example » jmx » notification » Java Open Source

Java Open Source » JMX » jfoxmx 
jfoxmx » example » jmx » notification » SimpleNotification.java
/* 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){

  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.