2つのバインディングに続くスコープにはどのようなものがあるのでしょうか。
bind(PermissionManager.class).in(Singleton.class);
と
bind(PermissionManager.class);
JavaDocsを読みましたが、次のとおりです。シングルトンの場合:
/**
* 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)
*/
スコープなし:
/**
* 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
*/
これは実際にはどういう意味ですか?シングルトンはクライアントごとですか、それともJVMごとですか?スコープがない場合、すべてのインスタンスは異なりますか?