Skip to content

Commit 4fa11e3

Browse files
committed
Test @ManagedNotification as a merged, composed annotation
Issue: SPR-13973
1 parent 54aeb7a commit 4fa11e3

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

spring-context/src/test/java/org/springframework/jmx/export/annotation/AnnotationTestBean.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616

1717
package org.springframework.jmx.export.annotation;
1818

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;
1924
import org.springframework.jmx.IJmxTestBean;
25+
import org.springframework.jmx.export.annotation.AnnotationTestBean.MyManagedNotification;
2026
import org.springframework.jmx.support.MetricType;
2127
import org.springframework.stereotype.Service;
2228

@@ -28,7 +34,7 @@
2834
@ManagedResource(objectName = "bean:name=testBean4", description = "My Managed Bean", log = true,
2935
logFile = "jmx.log", currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200,
3036
persistLocation = "./foo", persistName = "bar.jmx")
31-
@ManagedNotification(name="My Notification", notificationTypes={"type.foo", "type.bar"})
37+
@MyManagedNotification(notificationTypes = { "type.foo", "type.bar" })
3238
public class AnnotationTestBean implements IJmxTestBean {
3339

3440
private String name;
@@ -117,4 +123,17 @@ public int getCacheEntries() {
117123
return 3;
118124
}
119125

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+
120139
}

0 commit comments

Comments
 (0)