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.MBeanParameterInfo ; 55 import java.io.IOException ; 56 57 60 public class MBeanParameterInfoDeserializer extends AbstractDeserializer { 61 public Class getType() 62 { 63 return MBeanParameterInfo .class; 64 } 65 66 public Object readMap(AbstractHessianInput in) 67 throws IOException 68 { 69 String name = null; 70 String type = null; 71 String description = null; 72 boolean isRead = false; 73 boolean isWrite = false; 74 boolean isIs = false; 75 76 while (! in.isEnd()) { 77 String key = in.readString(); 78 79 if ("name".equals(key)) 80 name = in.readString(); 81 else if ("type".equals(key)) 82 type = in.readString(); 83 else if ("description".equals(key)) 84 description = in.readString(); 85 else { 86 in.readObject(); 87 } 88 } 89 90 in.readMapEnd(); 91 92 try { 93 MBeanParameterInfo info; 94 95 info = new MBeanParameterInfo (name, type, description); 96 97 return info; 98 } catch (Exception e) { 99 throw new IOException (String.valueOf(e)); 100 } 101 } 102 } 103 | Popular Tags |