KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.io.IOException JavaDoc;
12 import javax.management.MBeanServerNotification JavaDoc;
13 import javax.management.Notification JavaDoc;
14 import javax.xml.namespace.QName JavaDoc;
15
16 import org.apache.axis.encoding.SerializationContext;
17 import org.apache.axis.wsdl.fromJava.Types;
18 import org.w3c.dom.Element JavaDoc;
19
20 /**
21  * @version $Revision: 1.3 $
22  */

23 public class MBeanServerNotificationSer extends NotificationSer
24 {
25    static final String JavaDoc MBEAN_NAME = "mbeanName";
26    private static final QName JavaDoc MBEAN_NAME_QNAME = new QName JavaDoc("", MBEAN_NAME);
27
28    protected void onSerialize(SerializationContext context, Notification JavaDoc notification) throws IOException JavaDoc
29    {
30       super.onSerialize(context, notification);
31       MBeanServerNotification JavaDoc serverNotification = (MBeanServerNotification JavaDoc)notification;
32       context.serialize(MBEAN_NAME_QNAME, null, serverNotification.getMBeanName());
33    }
34
35    public Element JavaDoc writeSchema(Class JavaDoc aClass, Types types) throws Exception JavaDoc
36    {
37       // TODO: Use XML Schema syntax to specify that this is a subclass of Notification
38
return super.writeSchema(aClass, types);
39    }
40 }
41
Popular Tags