1 7 8 10 package org.jboss.net.jmx.adaptor; 11 12 import org.jboss.axis.Constants; 13 import org.jboss.axis.encoding.SerializationContext; 14 import org.jboss.axis.encoding.Serializer; 15 import org.jboss.axis.wsdl.fromJava.Types; 16 import org.w3c.dom.Element ; 17 import org.xml.sax.Attributes ; 18 19 import javax.management.MBeanNotificationInfo ; 20 import javax.xml.namespace.QName ; 21 import java.io.IOException ; 22 23 31 public class MBeanNotificationInfoSer implements Serializer 32 { 33 34 public void serialize(QName name, 35 Attributes attributes, 36 Object value, 37 SerializationContext context) 38 throws IOException 39 { 40 if (!(value instanceof MBeanNotificationInfo )) 41 throw new IOException ("Can't serialize a " 42 + value.getClass().getName() 43 + " instance with a MBeanNotificationInfo Serializer."); 44 context.startElement(name, attributes); 45 46 MBeanNotificationInfo info = (MBeanNotificationInfo )value; 47 context.serialize(new QName ("", "notifTypes"), 48 null, 49 info.getNotifTypes()); 50 context.serialize(new QName ("", "name"), null, info.getName()); 51 context.serialize(new QName ("", "description"), 52 null, 53 info.getDescription()); 54 55 context.endElement(); 56 return; 57 58 } 59 60 public Element writeSchema(Class aClass, Types types) throws Exception 61 { 62 return null; 63 } 64 65 public String getMechanismType() 66 { 67 return Constants.AXIS_SAX; 68 } 69 70 } | Popular Tags |