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.MBeanAttributeInfo ; 55 import java.io.IOException ; 56 57 60 public class MBeanAttributeInfoDeserializer extends AbstractDeserializer { 61 public Class getType() 62 { 63 return MBeanAttributeInfo .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 ("attributeType".equals(key)) 82 type = in.readString(); 83 else if ("description".equals(key)) 84 description = in.readString(); 85 else if ("isRead".equals(key)) 86 isRead = in.readBoolean(); 87 else if ("isWrite".equals(key)) 88 isWrite = in.readBoolean(); 89 else if ("is".equals(key)) 90 isIs = in.readBoolean(); 91 else { 92 in.readObject(); 93 } 94 } 95 96 in.readMapEnd(); 97 98 try { 99 MBeanAttributeInfo info; 100 101 info = new MBeanAttributeInfo (name, type, description, 102 isRead, isWrite, isIs); 103 104 return info; 105 } catch (Exception e) { 106 throw new IOException (String.valueOf(e)); 107 } 108 } 109 } 110 | Popular Tags |