The behavior is entirely up to your matcher implementation. You can write a matcher implementation that looks for annotations on superclasses too. Guice itself doesn't care -- it just asks your matcher, "Should I intercept this class/method?" If the matcher says Yes, Guice will intercept it.
sam On Wed, Sep 4, 2013 at 12:24 PM, mayumi <[email protected]> wrote: > Turned out that whenever you override a method intercepted in the child > class, interception is cancelled. > > > On Wednesday, 28 August 2013 13:55:49 UTC-5, mayumi wrote: >> >> I have a following hierarchical structure: >> >> public class ItemImpl extends RepositoryBase<ItemImpl> { >> @Inject >> ItemImpl( dependency ) { >> super( dependency ) >> } >> } >> >> public class RepositoryBase<T> extends Base<T> { >> public RepositoryBase( dependency ) { //Constructor without @Inject >> super( dependency ) >> } >> >> @Intercept <--- Works >> public someMethod( ) {} >> } >> >> public class Base<T> { >> public Base( dependency ){ } //Constructor without @Inject >> >> @Intercept <--- Does not work *** >> public someMethod( ) {} >> } >> >> As you can see above, Interception does not work at the level 3 of the >> hierarchy. According to Guice's AOP limitation, instance have to be created >> using Guice and child ItemImpl has constructor with @Inject so I guessed >> parents of this child should work. >> >> Why doesn't interception at level 3 doesn't work and why does the >> interception at level 2 works although it does not have constructor with >> @Inject? >> > -- > You received this message because you are subscribed to the Google Groups > "google-guice" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/google-guice. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-guice. For more options, visit https://groups.google.com/groups/opt_out.
