Open GoogleCodeExporter opened 9 years ago
This might also allow use of constructor injection in the interceptor.
Original comment by eric.j...@gmail.com
on 29 Jan 2010 at 8:09
We intentionally broke constructor injection on interceptors to avoid serious
and violient
never-ending recursion pain when an interceptor is itself intercepted.
Original comment by limpbizkit
on 30 Jan 2010 at 1:46
Doesn't non-constructor injection have the same recursion potential? I don't
suppose
there is a way to implement a requestInjectionWithoutInterception method?
Original comment by eric.j...@gmail.com
on 30 Jan 2010 at 6:24
requestInjection simply sets fields and calls methods annotated with @Inject,
it does
not setup interception.
Method interception only works on instances that were created by Guice.
Interception
is done by essentially proxy-wrapping the implementation and returning the
proxy. If
the instance is created outside Guice then there is no proxy and thus no
interception.
As limpbizkit mentioned, not allowing interception of interceptor methods is
safe
since it eliminates the possibility of infinite interceptor recursion. On the
downside it
doesn't allow any Guice-driven interception on interceptors.
Original comment by drew.mcl...@gmail.com
on 1 Feb 2010 at 4:21
Since it appears to be possible to do injection without setting up interception
(using requestInjection), shouldn't it also be possible to do constructor
injection
without setting up interception, or are the two somehow tied together?
Original comment by eric.j...@gmail.com
on 1 Feb 2010 at 6:05
Original issue reported on code.google.com by
eric.j...@gmail.com
on 29 Jan 2010 at 8:07