22

What does the following fields mean in Spring @ManagedResource used for JMX? There is no Javadoc or related description in Spring documentation.

 1. String persistPolicy() default "";
 2. int persistPeriod() default -1;
 3. String persistLocation() default "";
 4. int currencyTimeLimit() default -1;
Mohsen
  • 3,512
  • 3
  • 38
  • 66

2 Answers2

21

These are passed onto the JMX api - you can find more info about it in the JMX java doc. Copying the relevant section here -

 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  
gkamal
  • 20,777
  • 4
  • 60
  • 57
-1

I suspect that these annotation fields will have no effect - see e.g.: Did Java 5 forget JMX MBean persistence?

PaoloC
  • 519
  • 5
  • 5
  • The link you have attached seems to be broken – william cage Sep 18 '21 at 18:52
  • That link is well and truly gone - not even archive.org has a copy. But it's been a decade - I think by Googling "Spring @ManagedResource" today, you will find much better information. – PaoloC Sep 20 '21 at 09:34