01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.com
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package org.huihoo.jfox.jmx.interceptor;
09:
10: import javax.management.NotificationListener;
11: import javax.management.Notification;
12:
13: import org.huihoo.jfox.jmx.ExtendedMBeanServerNotification;
14:
15: /**
16: *
17: * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
18: */
19:
20: public class MBeanServerInterceptorListener implements
21: MBeanServerInterceptorListenerMBean, NotificationListener {
22: private boolean enabled = true;
23:
24: public void enable() {
25: enabled = true;
26: }
27:
28: public void disable() {
29: enabled = false;
30: }
31:
32: public boolean isEnabled() {
33: return enabled;
34: }
35:
36: public void handleNotification(Notification notification, Object obj) {
37: if (!isEnabled())
38: return;
39: }
40: }
|