1 48 49 package com.caucho.hessian.jmx; 50 51 import com.caucho.hessian.io.AbstractDeserializer; 52 import com.caucho.hessian.io.AbstractHessianInput; 53 54 import javax.management.MBeanConstructorInfo ; 55 import javax.management.MBeanParameterInfo ; 56 import java.io.IOException ; 57 58 61 public class MBeanConstructorInfoDeserializer extends AbstractDeserializer { 62 public Class getType() 63 { 64 return MBeanConstructorInfo .class; 65 } 66 67 public Object readMap(AbstractHessianInput in) 68 throws IOException 69 { 70 String name = null; 71 String description = null; 72 MBeanParameterInfo []sig = null; 73 74 while (! in.isEnd()) { 75 String key = in.readString(); 76 77 if ("name".equals(key)) 78 name = in.readString(); 79 else if ("description".equals(key)) 80 description = in.readString(); 81 else if ("signature".equals(key)) 82 sig = (MBeanParameterInfo []) in.readObject(MBeanParameterInfo [].class); 83 else { 84 in.readObject(); 85 } 86 } 87 88 in.readMapEnd(); 89 90 try { 91 MBeanConstructorInfo info; 92 93 info = new MBeanConstructorInfo (name, description, sig); 94 95 return info; 96 } catch (Exception e) { 97 throw new IOException (String.valueOf(e)); 98 } 99 } 100 } 101 | Popular Tags |