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.MBeanAttributeInfo ; 20 import javax.xml.namespace.QName ; 21 import java.io.IOException ; 22 23 31 public class MBeanAttributeInfoSer 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 MBeanAttributeInfo )) 41 throw new IOException ("Can't serialize a " 42 + value.getClass().getName() 43 + " instance with a MBeanAttributeInfo Serializer."); 44 context.startElement(name, attributes); 45 46 MBeanAttributeInfo info = (MBeanAttributeInfo )value; 47 context.serialize(new QName ("", "name"), null, info.getName()); 48 context.serialize(new QName ("", "type"), null, info.getType()); 49 context.serialize(new QName ("", "description"), 50 null, 51 info.getDescription()); 52 context.serialize(new QName ("", "isReadable"), 53 null, 54 new Boolean (info.isReadable())); 55 context.serialize(new QName ("", "isWritable"), 56 null, 57 new Boolean (info.isWritable())); 58 context.serialize(new QName ("", "isIs"), null, new Boolean (info.isIs())); 59 60 context.endElement(); 61 return; 62 63 } 64 65 public Element writeSchema(Class aClass, Types types) throws Exception 66 { 67 return null; 68 } 69 70 public String getMechanismType() 71 { 72 return Constants.AXIS_SAX; 73 } 74 75 } | Popular Tags |