Status: New
Owner: ----

New issue 386 by sberlin: Child Injector JIT Singletons Not Eager
http://code.google.com/p/google-guice/issues/detail?id=386

Similar to issue 373, but this time with implicit singletons.

Consider:

@Singleton class A { @Inject A(B b) {} }
@Singleton class B { }

AbstractModule {
  configure() {
     bind(A.class);
  }
}

If the module is used in a parent injector, B is eagerly constructed.  If
it's used in a child injector, B is not eagerly constructed.

FWIW, the patch I have attached to issue 38 can be used to fix this problem
(introducing a concept of listening to bindings, which can be used to
immediately instantiating singletons if they're supposed to be eager).

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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

Reply via email to