INT-3852: Support ObjectName Customization

JIRA: https://jira.spring.io/browse/INT-3852

Custom object names in `@IntegrationManagedResource` were ignored.

Some EIP objects were wrapped with their `Lifecycle` in order to expose
a single MBean with all attributes and operations.

This process "hid" the annotation so the object namer failed to detect the
presence of a custom object name or the other attributes.

Also, update the `@IntegrationManagedResource` to use the Spring 4.2 `@AliasFor` annotation.

INT-3852: Polishing

Polishing - Test with Proxy
This commit is contained in:
Gary Russell
2015-10-13 12:26:44 -04:00
committed by Artem Bilan
parent ccc1568b89
commit 2fb039004d
4 changed files with 282 additions and 26 deletions

View File

@@ -22,11 +22,13 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
import org.springframework.jmx.export.annotation.ManagedResource;
/**
* Clone of {@link ManagedResource} limiting beans thus annotated so that they
* will only be exported by the {@code IntegrationMBeanExporter}.
* will only be exported by the {@code IntegrationMBeanExporter} and prevented
* from being exported by other MBeanExporters (if present).
*
* @author Gary Russell
* @since 4.2
@@ -43,8 +45,10 @@ public @interface IntegrationManagedResource {
* attribute, for simple default usage.
* @return the value.
*/
@AliasFor("objectName")
String value() default "";
@AliasFor("value")
String objectName() default "";
String description() default "";