-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
None
I would like to change the JdbcUsersManager of CredentialsAwareLdapAndJdbcUsersManager but I met a problem.
To do this, I override initialize() method with a super.initialize() call following by my JdbcUsersManager calling.
But in the initialize() method of CredentialsAwareLdapAndJdbcUsersManager, the JdbcUsersManager is directly call and it generate an exception because I don't have the same parameters into the plugin.xml for my own JdbcUsersManager.
I suggest to externalize into a protected method the JdbcUsersManager initialization only.
Currently, we have :
@Override public void initialize() throws Exception { super.initialize(); // Create the fallback UsersManager and execute all its lifecycle operations. _fallbackUsersManager = new ModifiableCredentialsAwareJdbcUsersManager(); _fallbackUsersManager.contextualize(_context); _fallbackUsersManager.setPluginInfo(_pluginName, _featureName); _fallbackUsersManager.service(_serviceManager); _fallbackUsersManager.configure(_fbConfiguration); _fallbackUsersManager.initialize(); _fallbackUsersManager.enableLogging(getLogger()); }
And we should have :
@Override public void initialize() throws Exception { super.initialize(); _initializeJdbc(); } protected void _initializeJdbc() throws Exception { // Create the fallback UsersManager and execute all its lifecycle operations. _fallbackUsersManager = new ModifiableCredentialsAwareJdbcUsersManager(); _fallbackUsersManager.contextualize(_context); _fallbackUsersManager.setPluginInfo(_pluginName, _featureName); _fallbackUsersManager.service(_serviceManager); _fallbackUsersManager.configure(_fbConfiguration); _fallbackUsersManager.initialize(); _fallbackUsersManager.enableLogging(getLogger()); }
Like this, to change the JdbcUsersManager only, I just have to override _initializeJdbc().