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 javax.management.MBeanConstructorInfo ; 56 import javax.management.MBeanInfo ; 57 import javax.management.MBeanNotificationInfo ; 58 import javax.management.MBeanOperationInfo ; 59 import java.io.IOException ; 60 61 64 public class MBeanInfoDeserializer extends AbstractDeserializer { 65 public Class getType() 66 { 67 return MBeanInfo .class; 68 } 69 70 public Object readMap(AbstractHessianInput in) 71 throws IOException 72 { 73 String className = null; 74 String description = null; 75 MBeanAttributeInfo []attributes = null; 76 MBeanConstructorInfo []constructors = null; 77 MBeanOperationInfo []operations = null; 78 MBeanNotificationInfo []notifications = null; 79 80 while (! in.isEnd()) { 81 String key = in.readString(); 82 83 if ("className".equals(key)) 84 className = in.readString(); 85 else if ("description".equals(key)) 86 description = in.readString(); 87 else if ("attributes".equals(key)) { 88 attributes = (MBeanAttributeInfo []) in.readObject(MBeanAttributeInfo [].class); 89 } 90 96 else 97 in.readObject(); 98 } 99 100 in.readMapEnd(); 101 102 try { 103 MBeanInfo info; 104 105 info = new MBeanInfo (className, description, attributes, 106 constructors, operations, notifications); 107 108 return info; 109 } catch (Exception e) { 110 throw new IOException (String.valueOf(e)); 111 } 112 } 113 } 114 | Popular Tags |