After you defined the PropertiesFileSymbolProvider, you have to contribute
it to the SymbolSource service (see the HOWTO). Afterwards you can just
@Inject @Symbol("your-symbol-name-here") final String something into your
service builder method, e.g.

public YourService buildYourService(@Inject @Symbol("mysymbol") final
String mysymbol)
{
  // do something using mysymbol
}

The symbol's value will be searched in different places (see the HOWTO),
including the PropertiesFileSymbolProvider if contributed...

Uli

Am Di, 7.10.2008, 11:07, schrieb Edouard sur edouardmercier.fr:
> Thank you for this very quick and clear answer!
>
> Does it mean that I will be able to inject the
> "PropertiesFileSymbolProvider" object inside the
> "AppModule::bind(ServiceBinder binder,
> @InjectService("PropertiesFileSymbolProvider") SymbolProvider
> propertiesFileSymbolProvider)" method this way? Or should I declare a
> "@Inject @Symbol(value="MyParam") private String myParam;" (should be
> static) inside my AppModule (after having declared the properties
> symbol provider via the "public PropertiesFileSymbolProvider
> buildPropertiesFileSymbolProvider(Logger logger)" and "public static
> void contributeSymbolSource(OrderedConfiguration<SymbolProvider>
> configuration, ..." methods)?
>
> Because I need to access the property before the service is created,
> since it's implementation should depend on some property.
>
> Thank you.
> Édouard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to