22

@ManagedResource用于 JMX的 Spring 中的以下字段是什么意思?Spring 文档中没有 Javadoc 或相关描述。

1.字符串persistPolicy()默认"";
 2. int persistPeriod() 默认-1;
 3.字符串persistLocation() 默认"";
 4. int currencyTimeLimit() 默认-1;
4

2 回答 2

20

这些被传递到 JMX api - 您可以在JMX java doc中找到有关它的更多信息。在此处复制相关部分 -

 persistPolicy  : OnUpdate|OnTimer|NoMoreOftenThan|OnUnregister|Always|Never  
 persistLocation : The fully qualified directory name where the MBean should be persisted (if appropriate)
 persistFile    : File name into which the MBean should be persisted
 persistPeriod  : seconds - frequency of persist cycle for OnTime and NoMoreOftenThan PersistPolicy 
 currencyTimeLimit : how long value is valid, <0 never, =0 always, >0 seconds  
于 2012-05-14T11:20:45.333 回答
0

我怀疑这些注释字段将不起作用 - 参见例如:Java 5 忘记了 JMX MBean 持久性吗?

于 2013-10-11T16:13:21.763 回答