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 work and why does the interception at level 2 work? Both of the parents does not have constructor with @Inject?