One Josh Bloch quote to rule them all: "Don't make the user do work that the
library could do". So close() is fine. Its location is not ;-)

If you go for the MulticastInjector, you could probably even disable Closer
tracking completely when using regular Injectors.

Robbie

On Tue, Oct 7, 2008 at 4:14 PM, James Strachan <[EMAIL PROTECTED]>wrote:

>
> 2008/10/7 Gili Tzabari <[EMAIL PROTECTED]>:
> >    Alternatively, how about having the ability to return all Singletons
> > associated with an injector, then iterating through them and closing
> > them as appropriate. Meaning, the user would define some closable
> > interface and cast his Singletons to that type before invoking close().
> > Just a thought.
>
> FWIW my patch kinda does this - albeit under the covers -  each
> singleton is passed to the Closer strategy.
>
> Whether we go with a 'iterate through singletons' API or close() to
> 'invoke Closer strategies on singletons' approach, we'll need some
> kinda way to decorate the tree of Provider  objects so from the
> InjectorImpl you can navigate into the providers to find the
> singletons. Unless we replace the Scopes.SINGLETON implementation with
> a different implementation which maintain a Set of singletons created
> (though the former is probably more efficient).
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to