KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > monolog > wrapper > javaLog > JMXGenericHandler


1 /**
2  * Copyright (C) 2001-2003 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * 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  */

18
19 package org.objectweb.util.monolog.wrapper.javaLog;
20 import javax.management.ListenerNotFoundException JavaDoc;
21 import javax.management.MBeanNotificationInfo JavaDoc;
22 import javax.management.NotificationEmitter JavaDoc;
23 import javax.management.NotificationFilter JavaDoc;
24 import javax.management.NotificationListener JavaDoc;
25
26
27 /**
28  * Is a generic handler implementation used to wrapper java.util.logging.Handler
29  * instance.
30  * @author S.Chassande-Barrioz
31  */

32 public class JMXGenericHandler
33         extends GenericHandler
34         implements NotificationEmitter JavaDoc {
35     
36     public JMXGenericHandler() {
37         super();
38         type = "jmx";
39     }
40     
41     public void addNotificationListener(NotificationListener JavaDoc listener,
42             NotificationFilter JavaDoc filter,
43             Object JavaDoc handback)
44             throws IllegalArgumentException JavaDoc {
45         ((NotificationEmitter JavaDoc)handler).addNotificationListener( listener, filter, handback );
46     }
47     
48     public void removeNotificationListener( NotificationListener JavaDoc listener )
49     throws ListenerNotFoundException JavaDoc {
50         ((NotificationEmitter JavaDoc)handler).removeNotificationListener( listener );
51     }
52     
53     public void removeNotificationListener( NotificationListener JavaDoc listener,
54             NotificationFilter JavaDoc filter, Object JavaDoc handback)
55             throws ListenerNotFoundException JavaDoc {
56         ((NotificationEmitter JavaDoc)handler).removeNotificationListener( listener, filter, handback );
57     }
58     
59     public MBeanNotificationInfo JavaDoc[] getNotificationInfo(){
60         return ((NotificationEmitter JavaDoc)handler).getNotificationInfo();
61     }
62 }
Popular Tags