KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > management > AttributeAddNotification


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.jonas.management;
26
27 // JMX import
28
import javax.management.Notification JavaDoc;
29
30 /**
31  * Implements a notification class allowing to notify that an MBean attribute was mofified via the
32  * add<i>AttribureName</i> method.
33  */

34 public class AttributeAddNotification extends Notification JavaDoc {
35
36     static String JavaDoc ATTRIBUTE_ADD = "jonas.management.attribute.add";
37
38     String JavaDoc attributeName = null;
39     String JavaDoc addedValue = null;
40
41     /**
42      * Constructs an AttributeAddNotification object. In addition to the information common to all notifications,
43      * the caller must supply the name of the attribute that changed and the value of the added object.
44      * @param source The notification producer, that is, the MBean the attribute belongs to.
45      * @param sequenceNumber The notification sequence number within the source object.
46      * @param timeStamp The date at which the notification is being sent.
47      * @param message A String containing the message of this notification.
48      * @param attributeName A String giving the name of the attribute.
49      * @param addedValue A String giving the value added to the attribue's value
50      */

51     public AttributeAddNotification(Object JavaDoc source, long sequenceNumber, long timeStamp, String JavaDoc message, String JavaDoc attributeName, String JavaDoc addedValue) {
52         super(ATTRIBUTE_ADD, source, sequenceNumber, timeStamp, message);
53         this.attributeName = attributeName;
54         this.addedValue = addedValue;
55     }
56
57     public String JavaDoc getAttributeName() {
58         return attributeName;
59     }
60     
61     public String JavaDoc getAddedValue() {
62         return addedValue;
63     }
64
65     public String JavaDoc toString() {
66         String JavaDoc res = super.toString();
67         return res + "\n[ added resource: " + addedValue + " ]\n";
68     }
69 }
70
71
Popular Tags