01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package mx4j.tools.remote.soap.axis.ser;
10:
11: import javax.management.Notification;
12:
13: import org.xml.sax.SAXException;
14:
15: /**
16: * @version $Revision: 1.4 $
17: */
18: public class NotificationDeser extends AxisDeserializer {
19: private String type;
20: private Object source;
21: private long sequenceNumber;
22: private long timeStamp;
23: private String message;
24: private Object userData;
25:
26: public void onSetChildValue(Object value, Object hint)
27: throws SAXException {
28: if (NotificationSer.CLASS_NAME.equals(hint))
29: type = (String) value;
30: else if (NotificationSer.SOURCE.equals(hint))
31: source = value;
32: else if (NotificationSer.SEQUENCE_NUMBER.equals(hint))
33: sequenceNumber = ((Long) value).longValue();
34: else if (NotificationSer.TIMESTAMP.equals(hint))
35: timeStamp = ((Long) value).longValue();
36: else if (NotificationSer.MESSAGE.equals(hint))
37: message = (String) value;
38: else if (NotificationSer.USER_DATA.equals(hint))
39: userData = value;
40: }
41:
42: protected Object createObject() throws SAXException {
43: Notification notification = new Notification(getType(),
44: getSource(), getSequenceNumber(), getTimeStamp(),
45: getMessage());
46: notification.setUserData(getUserData());
47: return notification;
48: }
49:
50: protected String getType() {
51: return type;
52: }
53:
54: protected Object getSource() {
55: return source;
56: }
57:
58: protected long getSequenceNumber() {
59: return sequenceNumber;
60: }
61:
62: protected long getTimeStamp() {
63: return timeStamp;
64: }
65:
66: protected String getMessage() {
67: return message;
68: }
69:
70: protected Object getUserData() {
71: return userData;
72: }
73: }
|