Bind the class instead of the instance, so that Guice instantiates the
object, passing in dependencies in the process.
> and GatewayPool:
>
> public class GatewayPool {
> @Inject
> private GatewaysConfiguration configuration;
> ......
> public GatewayPool {
> configuration.doSomething();
> }
> }
>
That won't work, because you're trying to use a member in the
constructor that is not yet initialized. Change this to:
public class GatewayPool {
@Inject
public GatewayPool(GatewaysConfiguration configuration) {
configuration.doSomething();
}
}
Eelco
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
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.