Comment #11 on issue 216 by [email protected]: provider methods can't bind eager singletons
http://code.google.com/p/google-guice/issues/detail?id=216

It's an enhancement because you're left with clunky Guice 1.0 semantics as a workaround:

public class MyModule extends AbstractModule {

  static class MyProvider implements Provider<Foo> {
    @Inject Bar bar;
    @Inject Baz baz;

    public Foo get() {
      return Foo.from(bar, baz);
    }
  }

  public void configure() {
    bind(Foo.class).toProvider(MyProvider.class).asEagerSingleton();
  }
}



--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to