Sam Brannen opened SPR-11108 and commented
Status Quo
The findAnnotation() methods in AnnotationUtils currently support searching for meta-annotations declared on composed annotations that are declared on interfaces; however, various parts of the framework -- for example, code that relies on AnnotationAttributes - only support composed annotations on classes or methods (not on interfaces or interface methods).
For example, given the following:
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Transactional(rollbackFor=Exception.class, noRollbackFor={IOException.class})
public @interface TxWithAttribute {
boolean readOnly();
}
@TxWithAttribute(readOnly = true)
public static interface TestInterface9 {
public int getAge();
}
public static class TestBean9 implements TestInterface9 {
@Override
public int getAge() {
return 10;
}
}
public static interface TestInterface10 {
@TxWithAttribute(readOnly=true)
public int getAge();
}
public static class TestBean10 implements TestInterface10 {
@Override
public int getAge() {
return 10;
}
}
Spring's support for resolving transaction attributes (e.g., the AbstractFallbackTransactionAttributeSource.computeTransactionAttribute() to SpringTransactionAnnotationParser.parseTransactionAnnotation() call stack) fails to find @Transactional which is declared via @TxWithAttribute on interfaces.
Proposal
Introduce support for composable stereotype annotations declared on interfaces.
Affects: 4.0 RC1
Issue Links:
1 votes, 3 watchers
Sam Brannen opened SPR-11108 and commented
Status Quo
The
findAnnotation()methods inAnnotationUtilscurrently support searching for meta-annotations declared on composed annotations that are declared on interfaces; however, various parts of the framework -- for example, code that relies onAnnotationAttributes- only support composed annotations on classes or methods (not on interfaces or interface methods).For example, given the following:
Spring's support for resolving transaction attributes (e.g., the
AbstractFallbackTransactionAttributeSource.computeTransactionAttribute()toSpringTransactionAnnotationParser.parseTransactionAnnotation()call stack) fails to find@Transactionalwhich is declared via@TxWithAttributeon interfaces.Proposal
Introduce support for composable stereotype annotations declared on interfaces.
Affects: 4.0 RC1
Issue Links:
1 votes, 3 watchers