Keerthi K
2017-08-16 19:18:13 UTC
Hi,
I am trying to create a singleton instance per class loader instead of an
injector. I am fairly new to google guice and i am wondering if we can
create a singleton using google guice per class loader instead of an
injector?
I am trying to create a singleton instance per class loader instead of an
injector. I am fairly new to google guice and i am wondering if we can
create a singleton using google guice per class loader instead of an
injector?
Yes only one instance of key [Service] but not of key [ServiceImpl].
instance.
Dhanji.
<javascript:>>
instance.
Dhanji.
<javascript:>>
On another note, does the following code also generate one instance
per injector?
public class MyModule implements Module {
public void configure(Binder binder) {
binder.bind(Service.class)
.to(ServiceImpl.class)
.in(Scopes.SINGLETON);
}
}
From Guice's user guide.
per injector?
public class MyModule implements Module {
public void configure(Binder binder) {
binder.bind(Service.class)
.to(ServiceImpl.class)
.in(Scopes.SINGLETON);
}
}
From Guice's user guide.
That does help. Thanks!!
What I like about this group, I always learn something new, static
is
indeed per classloader:)
is
indeed per classloader:)
--
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 google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/5f867715-692c-4c13-a7c5-3818b17dbe40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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 google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/5f867715-692c-4c13-a7c5-3818b17dbe40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.