01: /*
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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;
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 {
35:
36: /**
37: *
38: */
39: private static final long serialVersionUID = 1L;
40:
41: static String ATTRIBUTE_ADD = "jonas.management.attribute.add";
42:
43: String attributeName = null;
44: String addedValue = null;
45:
46: /**
47: * Constructs an AttributeAddNotification object. In addition to the information common to all notifications,
48: * the caller must supply the name of the attribute that changed and the value of the added object.
49: * @param source The notification producer, that is, the MBean the attribute belongs to.
50: * @param sequenceNumber The notification sequence number within the source object.
51: * @param timeStamp The date at which the notification is being sent.
52: * @param message A String containing the message of this notification.
53: * @param attributeName A String giving the name of the attribute.
54: * @param addedValue A String giving the value added to the attribue's value
55: */
56: public AttributeAddNotification(Object source, long sequenceNumber,
57: long timeStamp, String message, String attributeName,
58: String addedValue) {
59: super (ATTRIBUTE_ADD, source, sequenceNumber, timeStamp, message);
60: this .attributeName = attributeName;
61: this .addedValue = addedValue;
62: }
63:
64: public String getAttributeName() {
65: return attributeName;
66: }
67:
68: public String getAddedValue() {
69: return addedValue;
70: }
71:
72: public String toString() {
73: String res = super .toString();
74: return res + "\n[ added resource: " + addedValue + " ]\n";
75: }
76: }
|