1 29 30 package com.caucho.jmx.remote; 31 32 import com.caucho.services.server.GenericService; 33 34 import javax.management.JMException ; 35 import javax.management.MBeanInfo ; 36 import javax.management.MBeanServerConnection ; 37 import javax.management.ObjectName ; 38 import java.io.IOException ; 39 40 43 public class ReadJMXService extends GenericService implements RemoteJMX { 44 private MBeanServerConnection _server; 45 46 49 public void setMBeanServer(MBeanServerConnection server) 50 { 51 _server = server; 52 } 53 54 57 public void init() 58 { 59 if (_server == null) 60 throw new NullPointerException ("mbean-server is required"); 61 } 62 63 66 public MBeanInfo getMBeanInfo(String objectName) 67 throws JMException , IOException 68 { 69 return _server.getMBeanInfo(new ObjectName (objectName)); 70 } 71 72 75 public Object getAttribute(String objectName, String attributeName) 76 throws JMException , IOException 77 { 78 return _server.getAttribute(new ObjectName (objectName), attributeName); 79 } 80 } 81 | Popular Tags |