/** * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the * managed resources {@link ClassLoader} before allowing the invocation to occur. * @see javax.management.modelmbean.ModelMBean#setAttributes */ @Override public AttributeList setAttributes(AttributeList attributes) { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.setAttributes(attributes); } 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#setAttributes */ @Override public AttributeList setAttributes(AttributeList attributes) { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.setAttributes(attributes); } 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#setAttributes */ @Override public AttributeList setAttributes(AttributeList attributes) { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.setAttributes(attributes); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } }