I don't understand what you are trying to achieve. Guice is all about injecting so you cannot have guice without an injector.
If you try to have Guice inject an instance depending on the current classloader you could try to write a scope which ensures one instance per classloader. Am 16. August 2017 21:18:13 MESZ schrieb Keerthi K <[email protected]>: >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? > >On Tuesday, April 22, 2008 at 9:06:13 PM UTC-5, dhanji wrote: >> >> Yes only one instance of key [Service] but not of key [ServiceImpl]. > >> So if you only @Inject Service everywhere you will receive the same >> instance. >> >> Dhanji. >> >> On 23/04/2008, at 10:04 AM, Karthik Krishnan <[email protected] >> <javascript:>> >> wrote: >> >> > >> > 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. >> > >> > >> > On Apr 22, 4:57 pm, Karthik Krishnan <[email protected]> >wrote: >> >> That does help. Thanks!! >> >> >> >> On Apr 22, 3:55 pm, Alen Vrečko <[email protected]> wrote: >> >> >> >>> What I like about this group, I always learn something new, >static >> >>> 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 [email protected]. >To post to this group, send email to [email protected]. >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 [email protected]. To post to this group, send email to [email protected]. 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/C59D74FB-4066-4B98-A526-1381F8BD5FCF%40gmx.ch. For more options, visit https://groups.google.com/d/optout.
