private void reloadPasswordValidator() { try { synchronized (passwordValidatorSynch) { if (passwordValidator != null) { passwordValidator.dispose(); passwordValidator = null; } if (passwdValDoc != null && isEnabled(passwdValDoc)) { Class<?> cls = getClass(passwdValDoc); if (cls != null) { if (OPasswordValidator.class.isAssignableFrom(cls)) { passwordValidator = (OPasswordValidator) cls.newInstance(); passwordValidator.config(server, serverConfig, passwdValDoc); passwordValidator.active(); } else { OLogManager.instance() .error( this, "ODefaultServerSecurity.reloadPasswordValidator() class is not an OPasswordValidator"); } } else { OLogManager.instance() .error( this, "ODefaultServerSecurity.reloadPasswordValidator() PasswordValidator class property is missing"); } } } } catch (Exception ex) { OLogManager.instance() .error( this, "ODefaultServerSecurity.reloadPasswordValidator() Exception: %s", ex.getMessage()); } }
// OServerLifecycleListener Interface public void onBeforeDeactivate() { if (enabled) { unregisterRESTCommands(); synchronized (importLDAPSynch) { if (importLDAP != null) { importLDAP.dispose(); importLDAP = null; } } synchronized (passwordValidatorSynch) { if (passwordValidator != null) { passwordValidator.dispose(); passwordValidator = null; } } synchronized (auditingSynch) { if (auditingService != null) { auditingService.dispose(); auditingService = null; } } synchronized (authenticatorsList) { // Notify all the security components that the server is active. for (OSecurityAuthenticator sa : authenticatorsList) { sa.dispose(); } authenticatorsList.clear(); } enabled = false; } }