equal
deleted
inserted
replaced
36 import javax.management.MBeanServer; |
36 import javax.management.MBeanServer; |
37 import javax.management.NotCompliantMBeanException; |
37 import javax.management.NotCompliantMBeanException; |
38 import javax.management.ObjectName; |
38 import javax.management.ObjectName; |
39 import javax.management.ReflectionException; |
39 import javax.management.ReflectionException; |
40 import com.sun.jmx.mbeanserver.MXBeanMappingFactory; |
40 import com.sun.jmx.mbeanserver.MXBeanMappingFactory; |
|
41 import sun.reflect.misc.ReflectUtil; |
41 |
42 |
42 /** |
43 /** |
43 * Base class for MBeans. There is one instance of this class for |
44 * Base class for MBeans. There is one instance of this class for |
44 * every Standard MBean and every MXBean. We try to limit the amount |
45 * every Standard MBean and every MXBean. We try to limit the amount |
45 * of information per instance so we can handle very large numbers of |
46 * of information per instance so we can handle very large numbers of |
129 final String msg = |
130 final String msg = |
130 "Resource class " + resource.getClass().getName() + |
131 "Resource class " + resource.getClass().getName() + |
131 " is not an instance of " + mbeanInterfaceType.getName(); |
132 " is not an instance of " + mbeanInterfaceType.getName(); |
132 throw new NotCompliantMBeanException(msg); |
133 throw new NotCompliantMBeanException(msg); |
133 } |
134 } |
|
135 ReflectUtil.checkPackageAccess(mbeanInterfaceType); |
134 this.resource = resource; |
136 this.resource = resource; |
135 MBeanIntrospector<M> introspector = getMBeanIntrospector(); |
137 MBeanIntrospector<M> introspector = getMBeanIntrospector(); |
136 this.perInterface = introspector.getPerInterface(mbeanInterfaceType); |
138 this.perInterface = introspector.getPerInterface(mbeanInterfaceType); |
137 this.mbeanInfo = introspector.getMBeanInfo(resource, perInterface); |
139 this.mbeanInfo = introspector.getMBeanInfo(resource, perInterface); |
138 } |
140 } |