/** * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the * managed resources {@link ClassLoader} before allowing the invocation to occur. * @see javax.management.modelmbean.ModelMBean#getAttribute */ @Override public Object getAttribute(String attrName) throws AttributeNotFoundException, MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.getAttribute(attrName); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } }
/** * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the * managed resources {@link ClassLoader} before allowing the invocation to occur. * @see javax.management.modelmbean.ModelMBean#getAttribute */ @Override public Object getAttribute(String attrName) throws AttributeNotFoundException, MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.getAttribute(attrName); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } }
/** * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the * managed resources {@link ClassLoader} before allowing the invocation to occur. * @see javax.management.modelmbean.ModelMBean#getAttribute */ @Override public Object getAttribute(String attrName) throws AttributeNotFoundException, MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.getAttribute(attrName); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } }