google-code-export / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
2 stars 1 forks source link

API to iterate the objects in a scope #354

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
For background see this thread...
http://groups.google.com/group/google-guice/browse_thread/thread/da6af0961cf4a5d
6

the issue is to be able to find all the objects in a scope easily so that they 
can be then closed.

Dhanji's great suggestion - is another implementation option - though it 
requires finding the 
binding for the current injectee object in the InjectionListener... 
http://code.google.com/p/google-guice/issues/detail?id=62 

So this patch just allows the provider created by a Scope to also implement the 
CachedValue 
interface so you can ask for the current cached value in a scope.

Original issue reported on code.google.com by james.st...@gmail.com on 6 Apr 2009 at 10:01

GoogleCodeExporter commented 9 years ago
Here's the patch and test case

Original comment by james.st...@gmail.com on 6 Apr 2009 at 10:02

Attachments:

GoogleCodeExporter commented 9 years ago
BTW recent refactorings of the InjectableType stuff broke this patch - I've got 
the patch refactored now in this 
Git mirror if its any help...

http://github.com/jstrachan/guicey/tree/master

here's the actual patch: 
http://github.com/jstrachan/guicey/commit/8672721184394127b383e7d854ea601fd41e4d
e9

Original comment by james.st...@gmail.com on 15 Apr 2009 at 3:24

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 26 Apr 2009 at 8:29

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 26 Apr 2009 at 9:30

GoogleCodeExporter commented 9 years ago

Original comment by sberlin on 22 Feb 2011 at 1:52