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 java.io.IOException;
12: import javax.management.MBeanServerNotification;
13: import javax.management.Notification;
14: import javax.xml.namespace.QName;
15:
16: import org.apache.axis.encoding.SerializationContext;
17: import org.apache.axis.wsdl.fromJava.Types;
18: import org.w3c.dom.Element;
19:
20: /**
21: * @version $Revision: 1.3 $
22: */
23: public class MBeanServerNotificationSer extends NotificationSer {
24: static final String MBEAN_NAME = "mbeanName";
25: private static final QName MBEAN_NAME_QNAME = new QName("",
26: MBEAN_NAME);
27:
28: protected void onSerialize(SerializationContext context,
29: Notification notification) throws IOException {
30: super .onSerialize(context, notification);
31: MBeanServerNotification serverNotification = (MBeanServerNotification) notification;
32: context.serialize(MBEAN_NAME_QNAME, null, serverNotification
33: .getMBeanName());
34: }
35:
36: public Element writeSchema(Class aClass, Types types)
37: throws Exception {
38: // TODO: Use XML Schema syntax to specify that this is a subclass of Notification
39: return super.writeSchema(aClass, types);
40: }
41: }
|