1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.modeler;
17
18 import javax.management.Notification;
19
20
21 /***
22 * Base JMX Notification. Supports in int code and notes - for faster
23 * access and dispatching.
24 *
25 * @author Costin Manolache
26 */
27 public final class BaseNotification extends Notification {
28
29
30 private int code;
31 private String type;
32 private Object source;
33 private long seq;
34 private long tstamp;
35
36 /***
37 * Private constructor.
38 */
39 private BaseNotification(String type,
40 Object source,
41 long seq,
42 long tstamp,
43 int code) {
44 super(type, source, seq, tstamp);
45 init( type, source, seq, tstamp, code );
46 this.code=code;
47 }
48
49 public void recycle() {
50
51 }
52
53 public void init( String type, Object source,
54 long seq, long tstamp, int code )
55 {
56 this.type=type;
57 this.source = source;
58 this.seq=seq;
59 this.tstamp=tstamp;
60 this.code = code;
61 }
62
63
64
65
66
67
68
69
70
71
72 /*** Action id, useable in switches and table indexes
73 */
74 public int getCode() {
75 return code;
76 }
77
78
79 private Object notes[]=new Object[32];
80
81 public final Object getNote(int i ) {
82 return notes[i];
83 }
84
85 public final void setNote(int i, Object o ) {
86 notes[i]=o;
87 }
88 }