thx again,

i just tried to wire up my server side with guice - the rpc part is done so 
far (thx to you). but on server side i also have some pojo 
interfaces/implementation that i want to inject via guice. but how to 
bootstrap this? at the moment i just added the module to my 
GuiceServletContextListener:

public class AppGuiceContextListener extends GuiceServletContextListener {

    @Override
    protected Injector getInjector() {
        return Guice.createInjector(new ServerModule(), new 
ServletModule());
    }

}

(not later than now i have to admit i am a total guice noob)
but imho somehow i need an injector instance on server side to get instances 
of classes that use injection?! something like that:
Injector i = Guice.createInjector(new ServerModule(), new ServletModule());
ClassThatHasSom@InjectInside instance = i.getInstance(
[email protected]);

So on Server i need a reference to the injector instance?! is it a good idea 
to store the injector in a (static?) field in AppGuiceContextListener or 
should i just call getInjector() whenever i need it?

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-guice/-/orv5N_ikTo4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to