/** * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the * managed resources {@link ClassLoader} before allowing the invocation to occur. * @see javax.management.modelmbean.ModelMBean#setAttribute */ @Override public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); super.setAttribute(attribute); } 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#setAttribute */ @Override public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); super.setAttribute(attribute); } 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#setAttribute */ @Override public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); super.setAttribute(attribute); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } }