The following map binder binding gives me a com.google.inject.OutOfScopeException: Not in MyScope:
mapbinder.addBinding("ferrari").to(Ferrari.class).in(Singleton.class);
I am guessing this is probably because the constructor of Ferrari has dependency on an object which is annotated with @MyScope. How can I create a Ferrari Singleton in such as case ?
I know that (how to create an object from a different scope) to create object of different scope, we need Providers. If that is the case what should I write in the get method of FerrariProvider so that it always returns me the same instance of Ferrari ? What ways do I have to create a Ferrari Singleton which depends on an object in a different scope ?