I got a little further. Now within my custom scope, I'm seeding both the
ApplicationConfiguration and the EntityManager:
scope.enter();
try
{
scope.seed(Key.get(ApplicationConfiguration.class), appConfig);
EntityManagerFactory emf =
injector.getInstance(Key.get(EntityManagerFactory.class,
Names.named(appConfig.getAppCode())));
EntityManager em = emf.createEntityManager();
scope.seed(Key.get(EntityManager.class), em);
//UserDao is bound with no scope, but to a provider....
UserDao userDao = injector.getInstance(UserDao.class);
}
finally
{
scope.exit();
}
See the above. UserDao is bound to a Provider that depends on the Injector
and ApplicationConfiguration being injected into it. I'm getting into
UserDaoProvider, and the injector has been set, but the
ApplicationConfiguration on which it depends is null.
Since I seeded an implementation of ApplicationConfiguration, shouldn't
that be injected into the UserDaoProvider?
--
You received this message because you are subscribed to the Google Groups
"google-guice" 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.
For more options, visit https://groups.google.com/groups/opt_out.