01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.org
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package javax.management;
09:
10: import java.io.Serializable;
11:
12: /**
13: * The type of the notification.
14: *
15: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
16: */
17:
18: /**
19: * Describes a notification emitted by an MBean.
20: */
21: public class MBeanNotificationInfo extends MBeanFeatureInfo implements
22: Cloneable, Serializable {
23:
24: private String[] types = null;
25:
26: /**
27: * Constructs an <CODE>MBeanNotificationInfo</CODE> object.
28: *
29: * @param notifsType The event type string (in dot notation).
30: * @param name The name of the <CODE>Notification</CODE> class.
31: * @param description A human readable description of the data.
32: *
33: */
34: public MBeanNotificationInfo(String[] notifsType, String name,
35: String description) {
36: super (name, description);
37: this .types = notifsType;
38: }
39:
40: public Object clone() {
41: try {
42: return super .clone();
43: } catch (CloneNotSupportedException clonenotsupportedexception) {
44: return null;
45: }
46: }
47:
48: /**
49: * Returns the notification type string (in dot notation) of the notification.
50: */
51: public String[] getNotifTypes() {
52: if (types != null) {
53: int len = types.length;
54: String[] res = new String[len];
55: for (int i = 0; i < len; i++) {
56: res[i] = new String(types[i]);
57: }
58: return res;
59: } else {
60: return new String[0];
61: }
62: }
63:
64: }
|