private void reloadImportLDAP() { try { synchronized (importLDAPSynch) { if (importLDAP != null) { importLDAP.dispose(); importLDAP = null; } if (ldapImportDoc != null && isEnabled(ldapImportDoc)) { Class<?> cls = getClass(ldapImportDoc); if (cls != null) { if (OSecurityComponent.class.isAssignableFrom(cls)) { importLDAP = (OSecurityComponent) cls.newInstance(); importLDAP.config(server, serverConfig, ldapImportDoc); importLDAP.active(); } else { OLogManager.instance() .error( this, "ODefaultServerSecurity.reloadImportLDAP() class is not an OSecurityComponent"); } } else { OLogManager.instance() .error( this, "ODefaultServerSecurity.reloadImportLDAP() ImportLDAP class property is missing"); } } } } catch (Exception ex) { OLogManager.instance() .error(this, "ODefaultServerSecurity.reloadImportLDAP() 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; } }