1 7 8 10 package org.jboss.net.jmx.adaptor; 11 12 import org.jboss.axis.encoding.DeserializationContext; 13 import org.jboss.axis.encoding.Deserializer; 14 import org.jboss.axis.encoding.DeserializerImpl; 15 import org.jboss.axis.encoding.DeserializerTarget; 16 import org.jboss.axis.message.SOAPHandler; 17 import org.xml.sax.Attributes ; 18 import org.xml.sax.SAXException ; 19 20 import javax.management.MBeanOperationInfo ; 21 import javax.management.MBeanParameterInfo ; 22 import javax.xml.namespace.QName ; 23 24 32 public class MBeanOperationInfoDeser extends DeserializerImpl 33 { 34 35 private String name; 36 private String description; 37 private MBeanParameterInfo [] signature; 38 private String type; 39 private int impact; 40 41 public void onStartElement(String namespace, 42 String localName, 43 String prefix, 44 Attributes attributes, 45 DeserializationContext context) 46 throws SAXException 47 { 48 49 if (context.isNil(attributes)) 50 { 51 return; 52 } 53 54 56 } 57 58 public SOAPHandler onStartChild(String namespace, 59 String localName, 60 String prefix, 61 Attributes attributes, 62 DeserializationContext context) 63 throws SAXException 64 { 65 66 QName itemType = 68 context.getTypeFromAttributes(namespace, localName, attributes); 69 Deserializer dSer = null; 71 if (itemType != null) 72 { 73 dSer = context.getDeserializerForType(itemType); 74 } 75 if (dSer == null) 76 { 77 dSer = new DeserializerImpl(); 78 } 79 80 dSer.registerValueTarget(new DeserializerTarget(this, localName)); 83 84 addChildDeserializer(dSer); 85 86 return (SOAPHandler)dSer; 87 } 88 89 public void setChildValue(Object value, Object hint) throws SAXException 90 { 91 if (hint.equals("name")) 92 name = (String )value; 93 else if (hint.equals("description")) 94 description = (String )value; 95 else if (hint.equals("signature")) 96 signature = (MBeanParameterInfo [])value; 97 else if (hint.equals("type")) 98 type = (String )value; 99 else if (hint.equals("impact")) 100 impact = ((Integer )value).intValue(); 101 102 } 103 104 public void onEndElement(String s, 105 String s1, 106 DeserializationContext deserializationcontext) 107 { 108 try 109 { 110 super.value = 111 new MBeanOperationInfo (name, description, signature, type, impact); 112 } 113 catch (Exception exception) 114 { 115 exception.printStackTrace(); 116 } 117 } 118 119 } 120 | Popular Tags |