Thanks for the answer!

I have real Singletons depending on objects that would be scoped as
reloadable. I guess this isn't an issue for Guice to solve then,
rather an application design issue. I'm thinking of injecting some
sort of container that holds the current instance of the object, the
container can be reset. Everywhere where I want to use object A I
would inject the container and do a .get(), something similar like a
provider but with a reset method.

Not sure I can come up with something better.

On May 24, 7:03 pm, "[email protected]" <[email protected]> wrote:
> On May 24, 7:47 am, "[email protected]"
>
> <[email protected]> wrote:
> > I have a bunch of singletons that should be singletons until the user
> > chose to reload parts of the application.
>
> If they need resetting, then they're not singletons! I recommend
> writing a new scope, "ReloadableScope", and binding all of the
> reloadable objects in that scope.
>
> Anything that depends on a ReloadableScoped object should itself be
> either ReloadableScoped or unscoped. If you have true singletons
> depending on ReloadableScoped objects, you might run into problems.
>
> Full instructions for implementing custom scopes are here:
>  http://code.google.com/docreader/#p=google-guice&s=google-guice&t=Cus...
--~--~---------~--~----~------------~-------~--~----~
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