>>>>> Jean-Baptiste Onofré <[email protected]>:

> Hi Steinar
> By default, SCR use the componentName as configuration PID.
> However, you can pass the configurationPid to the component and so
> several components can share the same configurationPid.

Thanks!

So far I've tried this:
@Component(service=UserManagementService.class, immediate=true, 
configurationPid="no.priv.bang.authservice.config", property= { 
"excessiveFailedLoginLimit:Integer=3" } )
public class UserManagementServiceProvider implements UserManagementService {

    @Activate
    public void activate(Map<String, Object> config) {
        excessiveFailedLoginLimit = (int) 
config.get("excessiveFailedLoginLimit");
    }

and this:
@Component( service=Realm.class, immediate=true, 
configurationPid="no.priv.bang.authservice.config" )
public class AuthserviceDbRealm extends JdbcRealm {

    @Activate
    public void activate(Map<String, Object> config) {

And UserManagementService.activate() receives excessiveFailedLoginLimit
in its map, while AuthserviceDbRealm.activate() does not receive
excessiveFailedLoginLimit in its map.

I guess I could get a value in AuthserviceDbRealm.activate by setting a
property argumenet to @Component there as well...?

But setting the default two places does sort of defeat the purpose (I
would like to set the default in a single place and use config to
override config for both components).

Reply via email to