01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.org
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package example.jmx.modelmbean;
09:
10: import javax.management.AttributeChangeNotification;
11: import javax.management.Notification;
12: import javax.management.NotificationListener;
13:
14: /**
15: *
16: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
17: */
18:
19: public class TestBeanAttributeChangeListener implements
20: NotificationListener {
21: public void handleNotification(Notification acn, Object handback) {
22: echo("\n\tTestBeanAttributeChangeListener received Attribute ChangeNotification ");
23: AttributeChangeNotification myacn = (AttributeChangeNotification) acn;
24: echo("\t\tEvent: " + acn.getType());
25: echo("\t\tAttribute: " + myacn.getAttributeName());
26: echo("\t\tAttribute type: " + myacn.getAttributeType());
27: echo("\t\tOld value: " + myacn.getOldValue());
28: echo("\t\tNew value: " + myacn.getNewValue());
29:
30: }
31:
32: private static void echo(String outstr) {
33: System.out.println(outstr);
34: }
35: }
|