Afaik @Inherited is only applied to annotation resolution if one uses
the reflection API. I am not aware of this annotation also being
checked for interceptor resolution.
So as @Binding1 is @Inherited, both interceptors are applied to Child
imho. If @Binding1 was not @Inherited, Child would not be intercepted.
br, Sven
-- sent by phone
Am 04.02.2010 um 22:38 schrieb Eric Covener <cove...@gmail.com>:
I'm looking into a potential interceptor problem where the proper
behavior of transitive interceptor bindings wrt @Inherited is a bit
unclear.
Anyone care to venture a guess at the desired behavior?
Parent.java:
@Binding1
public class Parent {
public void interceptme() { } ;
}
Child.java
public class Child extends Parent {
}
Binding1.java:
@InterceptorBinding
@Inherited
@Binding2 // this binding is @inherited
@Binding3 // this binding is NOT @inherited
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Binding1 {
}
consider two interceptors:
Interceptor2 has just @Binding2
Interceptor3 has just @Binding3
Currently, OWB doesn't get us any of these interceptors in the
Child.class, but we can easily find our way to at least Interceptor2.
But I am torn as to whether this should result in both interceptors or
just Interceptor2 (whose binding is @Inherited). 9.1.1 says:
"Interceptor bindings are transitive—an interceptor binding declar
ed
by an interceptor binding type is inherited by all beans and other
interceptor binding types that declare that interceptor binding type."
Is the @Inherited on the inner/nested binding types really not a
factor here?
Thanks,
--
Eric Covener
cove...@gmail.com