pombreda / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 1 forks source link

How can i set the classloader for the Guice #761

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi all:
i wanna set classloader to guice, which mean Guice could only be use in that 
classloader.

i can do that in spring with code:
GenericApplicationContext genericApplicationContext = new 
GenericApplicationContext();
genericApplicationContext.setClassLoader(cl); //set new classloader 
ConfigurableListableBeanFactory beanFactory = 
genericApplicationContext.getBeanFactory();

i don't know how to solve it in guice.
someone help me? thanks

Original issue reported on code.google.com by stream1...@gmail.com on 10 Aug 2013 at 1:29

GoogleCodeExporter commented 9 years ago
Could you give more details about the particular issue you're trying to solve?  
Guice operates on types not XML, and types already have an associated 
classloader.

Original comment by mccu...@gmail.com on 11 Aug 2013 at 12:43

GoogleCodeExporter commented 9 years ago
Well, i want to use guice in vertx (http://vertx.io.) as lang extend, but a lib.

Vertx have own classloader, i should use that class loader to load guice.

Original comment by stream1...@gmail.com on 12 Aug 2013 at 1:16

GoogleCodeExporter commented 9 years ago
There appears to be some integration support here: 
https://github.com/englishtown/vertx-mod-guice

Original comment by mccu...@gmail.com on 16 Oct 2013 at 10:16