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 -~----------~----~----~----~------~----~------~--~---
