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