/** * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the * managed resources {@link ClassLoader} before allowing the invocation to occur. * @see javax.management.modelmbean.ModelMBean#invoke */ @Override public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.invoke(opName, opArgs, sig); } 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#invoke */ @Override public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.invoke(opName, opArgs, sig); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } }
@Override public Object invoke(String opName, Object[] opArgs, String[] signature) throws MBeanException, ReflectionException { Object result = super.invoke(opName, opArgs, signature); if (methodListeners.contains(opName)) { this.sendNotification(buildCallListenerNotification(opName)); } return result; }
@Override public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException { try { return super.invoke(opName, opArgs, sig); } catch (MBeanException | ReflectionException | RuntimeException | Error e) { nbErrors.incrementAndGet(); onErrorInRemoteCall(e); throw e; } } };
@Override public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException { try { return super.invoke(opName, opArgs, sig); } catch (MBeanException | ReflectionException | RuntimeException | Error e) { nbErrors.incrementAndGet(); onErrorInRemoteCall(e); throw e; } } };
/** * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the * managed resources {@link ClassLoader} before allowing the invocation to occur. * @see javax.management.modelmbean.ModelMBean#invoke */ @Override public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader); return super.invoke(opName, opArgs, sig); } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); } }
@Override public Object invoke(String opName, Object[] opArgs, String[] signature) throws MBeanException, ReflectionException { Object result = super.invoke(opName, opArgs, signature); if (methodListeners.contains(opName)) { this.sendNotification(buildCallListenerNotification(opName)); } return result; }
@Override public Object invoke(String opName, Object[] opArgs, String[] signature) throws MBeanException, ReflectionException { Object result = super.invoke(opName, opArgs, signature); if (methodListeners.contains(opName)) { this.sendNotification(buildCallListenerNotification(opName)); } return result; }
@Override public Object invoke(String opName, Object[] opArgs, String[] signature) throws MBeanException, ReflectionException { Object result = super.invoke(opName, opArgs, signature); if (methodListeners.contains(opName)) { this.sendNotification(buildCallListenerNotification(opName)); } return result; }
@Override public Object invoke(String opName, Object[] opArgs, String[] signature) throws MBeanException, ReflectionException { Object result = super.invoke(opName, opArgs, signature); if (methodListeners.contains(opName)) { this.sendNotification(buildCallListenerNotification(opName)); } return result; }