KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > remote > soap > axis > ser > NotificationResultDeser


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.tools.remote.soap.axis.ser;
10
11 import javax.management.remote.NotificationResult JavaDoc;
12 import javax.management.remote.TargetedNotification JavaDoc;
13
14 import org.xml.sax.SAXException JavaDoc;
15
16 /**
17  * @version $Revision: 1.4 $
18  */

19 public class NotificationResultDeser extends AxisDeserializer
20 {
21    private long earliestSequenceNumber;
22    private long nextSequenceNumber;
23    private TargetedNotification JavaDoc[] targetedNotifications;
24
25    public void onSetChildValue(Object JavaDoc value, Object JavaDoc hint) throws SAXException JavaDoc
26    {
27       if (NotificationResultSer.EARLIEST_NUMBER.equals(hint))
28          earliestSequenceNumber = ((Long JavaDoc)value).longValue();
29       else if (NotificationResultSer.NEXT_NUMBER.equals(hint))
30          nextSequenceNumber = ((Long JavaDoc)value).longValue();
31       else if (NotificationResultSer.NOTIFICATIONS.equals(hint)) targetedNotifications = (TargetedNotification JavaDoc[])value;
32    }
33
34    protected Object JavaDoc createObject() throws SAXException JavaDoc
35    {
36       return new NotificationResult JavaDoc(earliestSequenceNumber, nextSequenceNumber, targetedNotifications);
37    }
38 }
39
Popular Tags