Hi Eric; I think that both @Binding2 and @Binding3 are inherited by sub-classes. @Inherited is used for getting annotations from subclass. @Binding1 is annotated with @Inherited therefore we must get @Binding1 and all its transitive interceptors @Binding2 and @Binding3.
Your patch seems to handle problem this way. Thanks; --Gurkan 2010/2/4 Eric Covener <[email protected]> > 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 declared > 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 > [email protected] > -- Gurkan Erdogdu http://gurkanerdogdu.blogspot.com
