1 48 49 package com.caucho.services.jmx; 50 51 import java.io.IOException; 52 53 import javax.management.MBeanAttributeInfo; 54 import javax.management.MBeanServerConnection; 55 import javax.management.ObjectName; 56 import javax.management.ObjectInstance; 57 import javax.management.MBeanInfo; 58 import javax.management.JMException; 59 60 import com.caucho.services.server.GenericService; 61 62 65 public class ReadJMXService extends GenericService implements RemoteJMX { 66 private MBeanServerConnection _server; 67 68 71 public void setMBeanServer(MBeanServerConnection server) 72 { 73 _server = server; 74 } 75 76 79 public void init() 80 { 81 if (_server == null) 82 throw new NullPointerException("mbean-server is required"); 83 } 84 85 88 public MBeanInfo getMBeanInfo(String objectName) 89 throws JMException, IOException 90 { 91 return _server.getMBeanInfo(new ObjectName(objectName)); 92 } 93 94 97 public Object getAttribute(String objectName, String attributeName) 98 throws JMException, IOException 99 { 100 return _server.getAttribute(new ObjectName(objectName), attributeName); 101 } 102 } 103 | Popular Tags |