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