|
|
|
@ -16,7 +16,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.jmx.export.annotation; |
|
|
|
package org.springframework.jmx.export.annotation; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
|
|
|
|
import java.lang.annotation.Retention; |
|
|
|
|
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.core.annotation.AliasFor; |
|
|
|
import org.springframework.jmx.IJmxTestBean; |
|
|
|
import org.springframework.jmx.IJmxTestBean; |
|
|
|
|
|
|
|
import org.springframework.jmx.export.annotation.AnnotationTestBean.MyManagedNotification; |
|
|
|
import org.springframework.jmx.support.MetricType; |
|
|
|
import org.springframework.jmx.support.MetricType; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
@ -28,7 +34,7 @@ import org.springframework.stereotype.Service; |
|
|
|
@ManagedResource(objectName = "bean:name=testBean4", description = "My Managed Bean", log = true, |
|
|
|
@ManagedResource(objectName = "bean:name=testBean4", description = "My Managed Bean", log = true, |
|
|
|
logFile = "jmx.log", currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200, |
|
|
|
logFile = "jmx.log", currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200, |
|
|
|
persistLocation = "./foo", persistName = "bar.jmx") |
|
|
|
persistLocation = "./foo", persistName = "bar.jmx") |
|
|
|
@ManagedNotification(name="My Notification", notificationTypes={"type.foo", "type.bar"}) |
|
|
|
@MyManagedNotification(notificationTypes = { "type.foo", "type.bar" }) |
|
|
|
public class AnnotationTestBean implements IJmxTestBean { |
|
|
|
public class AnnotationTestBean implements IJmxTestBean { |
|
|
|
|
|
|
|
|
|
|
|
private String name; |
|
|
|
private String name; |
|
|
|
@ -117,4 +123,17 @@ public class AnnotationTestBean implements IJmxTestBean { |
|
|
|
return 3; |
|
|
|
return 3; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ManagedNotification(name = "My Notification", notificationTypes = {}) |
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
|
|
|
|
@Inherited |
|
|
|
|
|
|
|
public static @interface MyManagedNotification { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AliasFor(annotation = ManagedNotification.class) |
|
|
|
|
|
|
|
String description() default ""; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AliasFor(annotation = ManagedNotification.class) |
|
|
|
|
|
|
|
String[] notificationTypes(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|