In my app, I am binding an embedded HornetQServer instance. I do that with 
a @Provides in my module. I also bind a hornetq ClientSession object with 
an @Provides method in my module. The HornetQServer needs to be initialized 
before I can create a client session. Is there a way to control the order 
in which guice calls the @Provides methods? Is there other options, i'm not 
necessarily locked into the @Provides, but I also tried doing explicitly 
like this in the Module's configure method to no avail. Thanks for any help.

@Override
    protected void configure() {
        bind(HornetQServer.class).toProvider(new Provider<HornetQServer>() {
            @Override
            public HornetQServer get() {
                //create it here
            }
        });
        bind(ClientSession.class).toProvider(new Provider<ClientSession>() {
            @Override
            public ClientSession get() {
                //return null;
            }
        });
        //more binding calls follow

-- 
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 http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to