implements DynamicMBean2, MBeanRegistration {
<T> MBeanSupport(T resource, Class<T> mbeanInterface)
throws NotCompliantMBeanException {
if (mbeanInterface == null)
throw new NotCompliantMBeanException("Null MBean interface");
if (!mbeanInterface.isInstance(resource)) {
final String msg =
"Resource class " + resource.getClass().getName() +
" is not an instance of " + mbeanInterface.getName();
throw new NotCompliantMBeanException(msg);
}
this.resource = resource;
MBeanIntrospector<M> introspector = getMBeanIntrospector();
this.perInterface = introspector.getPerInterface(mbeanInterface);
this.mbeanInfo = introspector.getMBeanInfo(resource, perInterface);