Hi Again,

Now I have a Service that I want to configure with a string parameter
and an int parameter. I add a couple of values to the
ApplicationDefaults like this:

 

configuration.add("my.long.key.string-value",
"aStringINeedInMyService");

configuration.add("my.long.key.int-value", "180");

 

 

And in my service I have a constructor like this:

 

private final int intINeedInMyService;

private final String stringINeedInMyService;

 

 

                public MyNewServiceImpl (@Value("${my.long.key.int-value
}")

                final int cookieAgeInDays,
@Value("${my.long.key.string-value }")

                final String cookieName) {

                                this. intINeedInMyService =
intINeedInMyService;

                                this. stringINeedInMyService =
stringINeedInMyService;

                }

 

}

 

This seems to work except that the value of "stringINeedInMyService" is
always the Service's Service Id. I verified this by changing the Id of
the service in the AppModule by calling binder.bind(MyNewService.class,
MyNewServiceImpl.class).withId("MyDifferentId") and behold the value
injected into the String constructor parameter for the MyNewServiceImpl
was the new service Id. Is this expected behavior (IE have I miss
understood how to configure my service)? Or is there something else
going on? Has anyone configured a service this way before?

 

Many thanks

 

Russell



Communications on or through ioko's computer systems may be monitored or 
recorded to secure effective system operation and for other lawful purposes.

Unless otherwise agreed expressly in writing, this communication is to be 
treated as confidential and the information in it may not be used or disclosed 
except for the purpose for which it has been sent. If you have reason to 
believe that you are not the intended recipient of this communication, please 
contact the sender immediately. No employee is authorised to conclude any 
binding agreement on behalf of ioko with another party by e-mail without prior 
express written confirmation.

ioko365 Ltd.  VAT reg 656 2443 31. Reg no 3048367. All rights reserved.

Reply via email to