I wonder what scopes folowing two bindings have:
bind(PermissionManager.class).in(Singleton.class);
and
bind(PermissionManager.class);
I have read the JavaDocs, they are as following. For Singleton:
/**
* Apply this to implementation classes when you want only one instance
* (per {@link Injector}) to be reused for all injections for that binding.
*
* @author crazybob@google.com (Bob Lee)
*/
For no scope:
/**
* No scope; the same as not applying any scope at all. Each time the
* Injector obtains an instance of an object with "no scope", it injects this
* instance then immediately forgets it. When the next request for the same
* binding arrives it will need to obtain the instance over again.
*
* <p>This exists only in case a class has been annotated with a scope
* annotation such as {@link Singleton @Singleton}, and you need to override
* this to "no scope" in your binding.
*
* @since 2.0
*/
What does this mean in practical terms? Are singletons per client or per JVM? For no scope, is every instance different?