01: /**
02: * Copyright (C) 2001-2003 France Telecom R&D
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package org.objectweb.util.monolog.wrapper.javaLog;
18:
19: import javax.management.ListenerNotFoundException;
20: import javax.management.MBeanNotificationInfo;
21: import javax.management.NotificationEmitter;
22: import javax.management.NotificationFilter;
23: import javax.management.NotificationListener;
24:
25: /**
26: * Is a generic handler implementation used to wrapper java.util.logging.Handler
27: * instance.
28: * @author S.Chassande-Barrioz
29: */
30: public class JMXGenericHandler extends GenericHandler implements
31: NotificationEmitter {
32:
33: public JMXGenericHandler() {
34: super ();
35: type = "jmx";
36: }
37:
38: public void addNotificationListener(NotificationListener listener,
39: NotificationFilter filter, Object handback)
40: throws IllegalArgumentException {
41: ((NotificationEmitter) handler).addNotificationListener(
42: listener, filter, handback);
43: }
44:
45: public void removeNotificationListener(NotificationListener listener)
46: throws ListenerNotFoundException {
47: ((NotificationEmitter) handler)
48: .removeNotificationListener(listener);
49: }
50:
51: public void removeNotificationListener(
52: NotificationListener listener, NotificationFilter filter,
53: Object handback) throws ListenerNotFoundException {
54: ((NotificationEmitter) handler).removeNotificationListener(
55: listener, filter, handback);
56: }
57:
58: public MBeanNotificationInfo[] getNotificationInfo() {
59: return ((NotificationEmitter) handler).getNotificationInfo();
60: }
61: }
|