01: /*
02: * Copyright (c) 2003, Intracom S.A. - www.intracom.com
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: *
18: * This package and its source code is available at www.jboss.org
19: **/
20: package org.jboss.jmx.adaptor.snmp.test;
21:
22: import javax.management.Notification;
23:
24: import org.jboss.system.ServiceMBeanSupport;
25:
26: /**
27: * <tt>NotificationProducerService</tt> is a test class with an MBean interface
28: * used to produce simple JMX notifications to be intercepted and mapped to SNMP
29: * traps by the snmp JMX adaptor
30: *
31: * @version $Revision: 23902 $
32: *
33: * @author <a href="mailto:spol@intracom.gr">Spyros Pollatos</a>
34: * @author <a href="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
35: *
36: * @jmx:mbean
37: * extends="org.jboss.system.ServiceMBean"
38: **/
39: public class NotificationProducerService extends ServiceMBeanSupport
40: implements NotificationProducerServiceMBean {
41: /**
42: * Sends a test Notification of type "V1"
43: *
44: * @jmx:managed-operation
45: **/
46: public void sendV1() throws Exception {
47: sendNotification(new Notification("V1", this ,
48: getNextNotificationSequenceNumber(),
49: "V1 test notifications"));
50: }
51:
52: /**
53: * Sends a test Notification of type "V2"
54: *
55: * @jmx:managed-operation
56: **/
57: public void sendV2() throws Exception {
58: sendNotification(new Notification("V2", this ,
59: getNextNotificationSequenceNumber(),
60: "V2 test notifications"));
61: }
62:
63: } // class NotificationProducerService
|