|
16 | 16 |
|
17 | 17 | package org.springframework.jmx.export.annotation;
|
18 | 18 |
|
| 19 | +import java.lang.annotation.Inherited; |
| 20 | +import java.lang.annotation.Retention; |
| 21 | +import java.lang.annotation.RetentionPolicy; |
| 22 | + |
| 23 | +import org.springframework.core.annotation.AliasFor; |
19 | 24 | import org.springframework.jmx.IJmxTestBean;
|
| 25 | +import org.springframework.jmx.export.annotation.AnnotationTestBean.MyManagedNotification; |
20 | 26 | import org.springframework.jmx.support.MetricType;
|
21 | 27 | import org.springframework.stereotype.Service;
|
22 | 28 |
|
|
28 | 34 | @ManagedResource(objectName = "bean:name=testBean4", description = "My Managed Bean", log = true,
|
29 | 35 | logFile = "jmx.log", currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200,
|
30 | 36 | persistLocation = "./foo", persistName = "bar.jmx")
|
31 |
| -@ManagedNotification(name="My Notification", notificationTypes={"type.foo", "type.bar"}) |
| 37 | +@MyManagedNotification(notificationTypes = { "type.foo", "type.bar" }) |
32 | 38 | public class AnnotationTestBean implements IJmxTestBean {
|
33 | 39 |
|
34 | 40 | private String name;
|
@@ -117,4 +123,17 @@ public int getCacheEntries() {
|
117 | 123 | return 3;
|
118 | 124 | }
|
119 | 125 |
|
| 126 | + |
| 127 | + @ManagedNotification(name = "My Notification", notificationTypes = {}) |
| 128 | + @Retention(RetentionPolicy.RUNTIME) |
| 129 | + @Inherited |
| 130 | + public static @interface MyManagedNotification { |
| 131 | + |
| 132 | + @AliasFor(annotation = ManagedNotification.class) |
| 133 | + String description() default ""; |
| 134 | + |
| 135 | + @AliasFor(annotation = ManagedNotification.class) |
| 136 | + String[] notificationTypes(); |
| 137 | + } |
| 138 | + |
120 | 139 | }
|
0 commit comments