KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jmx > adaptor > snmp > test > NotificationProducerService


1 /*
2  * Copyright (c) 2003, Intracom S.A. - www.intracom.com
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  * 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 JavaDoc;
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
40    extends ServiceMBeanSupport
41    implements NotificationProducerServiceMBean
42 {
43    /**
44     * Sends a test Notification of type "V1"
45     *
46     * @jmx:managed-operation
47    **/

48    public void sendV1()
49       throws Exception JavaDoc
50    {
51       sendNotification(
52          new Notification JavaDoc("V1", this, getNextNotificationSequenceNumber(),
53                           "V1 test notifications"));
54    }
55
56    /**
57     * Sends a test Notification of type "V2"
58     *
59     * @jmx:managed-operation
60    **/

61    public void sendV2()
62       throws Exception JavaDoc
63    {
64       sendNotification(
65          new Notification JavaDoc("V2", this, getNextNotificationSequenceNumber(),
66                           "V2 test notifications"));
67    }
68    
69 } // class NotificationProducerService
70

71
Popular Tags