On Tue, Oct 7, 2008 at 10:48 PM, jus <[EMAIL PROTECTED]> wrote:
> GuiceSetup snippet:
>
> @Override
> protected void configure() {
> System.out.println("GuiceSetupModule configure INVOKED");
>
> bind(GatewayAccessor.class)
> .to(GatewayAccessorImpl.class)
> .in(Scopes.SINGLETON);
>
> bind(GatewayAuthenticator.class)
> .to(GatewayAuthenticatorImpl.class)
> .in(Scopes.SINGLETON);
>
> Properties properties = loadProperties();
> Names.bindProperties(binder(), properties);
> }
>
As a best practice, consider binding to the Singleton annotation instead of
the instance (Scopes.SINGLETON).
>
> Code to Inject:
>
> @Inject @Named("gateway.UserId")
> private String userId;
> @Inject
> private GatewayAuthenticator gatewayAuthenticator;
> @Inject
> private GatewayAccessor gatewayAccessor;
>
In which class have these fields been defined? Is it a class Guice creates?
(for example, servlets do not get created by Guice)
Could you tell us how and when you create the Injector?
Robbie
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---