Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私のアプリケーションには、2つのシングルトンインスタンスがあり、どちらもGoogleGuiceによって作成されています。
どうしてそれも可能ですか?
バインディングは次のように行われます。
bind(Foo.class).to(FooImpl.class).in(Scopes.SINGLETON);
ここでの問題は、バインディング宣言でした。
バインディング宣言を次のように置き換えることで修正しました。
bind(FooImpl.class).in(Scopes.SINGLETON); bind(Foo.class).to(FooImpl.class);