Open GoogleCodeExporter opened 9 years ago
I think we should start by making scopes Guice "managed" (injectable); and then
there's perhaps some AOP stuff possible to solve this issue.
Original comment by robbie.v...@gmail.com
on 23 Aug 2007 at 8:57
I have already implemented this feature using a scope wrapper, but
unfortunately this
meta-scope was not able to retrieve the dependency from the original scope due
to a
NullPointerException.
Just have a look at issue #190 and
http://groups.google.com/group/google-guice/browse_thread/thread/fd1c65570f0f07c
a for
a sample implementation.
Original comment by sven.lin...@gmail.com
on 21 Apr 2008 at 10:27
This is crazy reflective code you're writing, but generally the problem you're
reporting is a real one.
The problem is that the Provider provided to Scope.scope() doesn't work when
being executed somewhere
other than a get() method. I'll try to write a simplified testcase that
demonstrates the problem...
Original comment by limpbizkit
on 4 Jun 2008 at 1:50
As far as I remember, I attached an implementation and of course failing junit
test
in issue #190.
I digged a little bit into the problem, but unfortunately I am not very
familiar with
the internals of Guice. It looks like the method call Scope.scope() is done
using a
thread local instance of InternalContext located in the InjectorImpl, which is
unset
after the scope() call. This rather looks like a design issue to me than a
simple
programming bug.
Original comment by sven.lin...@gmail.com
on 4 Jun 2008 at 10:05
Original comment by limpbizkit
on 5 Jun 2008 at 6:51
[deleted comment]
Original comment by limpbizkit
on 18 Nov 2008 at 7:33
Solved with extension-like code (search the groups for LazyProvider &
@LazySingleton).
Original comment by sberlin
on 2 May 2010 at 12:40
Original issue reported on code.google.com by
sberlin
on 2 Aug 2007 at 2:29