在我的基于Spring 3.1的应用程序中,@ManagedAttributes和@ManagedOperations都未被捕获或记录。 - 春天似乎默认情况下,出口的所有操作/属性
public class LoggingFailedCallsMBeanExporter extends MBeanExporter {
protected ModelMBean createModelMBean() throws MBeanException {
// super method does:
// return (this.exposeManagedResourceClassLoader ? new SpringModelMBean() : new RequiredModelMBean());
ModelMBean superModelMBean = super.createModelMBean();
// but this.exposeManagedResourceClassLoader is not visible, so we switch on the type of the returned ModelMBean
if (superModelMBean instanceof SpringModelMBean) {
return new SpringModelMBean() {
@Override
public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException {
try {
return super.invoke(opName, opArgs, sig);
} catch (MBeanException e) {
LOGGER.warn("Issue on a remote call", e);
throw e;
} catch (ReflectionException e) {
LOGGER.warn("Issue on a remote call", e);
throw e;
} catch (RuntimeException e) {
LOGGER.warn("Issue on a remote call", e);
throw e;
} catch (Error e) {
LOGGER.warn("Issue on a remote call", e);
throw e;
}
}
};
} else {
return new RequiredModelMBean() {
@Override
public Object invoke(String opName, Object[] opArgs, String[] sig) throws MBeanException, ReflectionException {
try {
return super.invoke(opName, opArgs, sig);
} catch (MBeanException e) {
LOGGER.warn("Issue on a remote call", e);
throw e;
} catch (ReflectionException e) {
LOGGER.warn("Issue on a remote call", e);
throw e;
} catch (RuntimeException e) {
LOGGER.warn("Issue on a remote call", e);
throw e;
} catch (Error e) {
LOGGER.warn("Issue on a remote call", e);
throw e;
}
}
};
}
}
来源
2013-12-12 08:58:51
bla
我没有使用任何注释:
所以我通过扩展的MBeanExporter的,其失败每当MBean的方法调用失败去了。我会尝试在有问题的操作中添加一个注释,然后看看它做了什么,谢谢。 – 2010-09-07 19:04:42
在我的应用程序中,@ManagedOperation方法没有被捕获和记录 – bla 2013-12-12 08:52:58