On Dec 1, 9:44 pm, "Dhanji R. Prasanna" <[EMAIL PROTECTED]> wrote:
> I am seeing loads of abuses of eager singleton as a "startup"
> lifecycle hook. I wonder if it would be worth us deprecating it or
> making it show a warning of some sort.
>
> Since this doesn't really mean anything in PROD mode, perhaps it
> should be an annotation instead? bind() .in(EagerSingleton.class).
> Thinking aloud...
First we should provide guidance on how to do lifecycle with Guice.
I've started to poke at this problem, but I haven't done anything too
seriously yet. We should be evangelizing something along these
lines...
public static void main(String[] args) {
Injector injector = Guice.createInjector(...)
Set<Service> services = injector.getInstance(...);
for (Service service : services) {
service.start();
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice-dev" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---