Search in sources :

Example 1 with ApplicationInitializedEvent

use of org.gluu.service.cdi.event.ApplicationInitializedEvent in project oxTrust by GluuFederation.

the class AppInitializer method applicationInitialized.

/**
 * Initialize components and schedule DS connection time checker
 */
public void applicationInitialized(@Observes @Initialized(ApplicationScoped.class) Object init) {
    log.debug("Initializing application services");
    showBuildInfo();
    configurationFactory.create();
    PersistenceEntryManager localLdapEntryManager = persistenceEntryManagerInstance.get();
    initializeLdifArchiver(localLdapEntryManager);
    // Initialize template engine
    templateService.initTemplateEngine();
    // Initialize python interpreter
    pythonService.initPythonInterpreter(configurationFactory.getBaseConfiguration().getString("pythonModulesDir", null));
    // Initialize Shibboleth
    shibbolethInitializer.createShibbolethConfiguration();
    // Initialize script manager
    List<CustomScriptType> supportedCustomScriptTypes = Arrays.asList(CustomScriptType.CACHE_REFRESH, CustomScriptType.UPDATE_USER, CustomScriptType.USER_REGISTRATION, CustomScriptType.ID_GENERATOR, CustomScriptType.PERSISTENCE_EXTENSION);
    // Start timer
    initSchedulerService();
    // Schedule timer tasks
    metricService.initTimer();
    configurationFactory.initTimer();
    loggerService.initTimer();
    ldapStatusTimer.initTimer();
    metadataValidationTimer.initTimer();
    entityIDMonitoringService.initTimer();
    cacheRefreshTimer.initTimer();
    customScriptManager.initTimer(supportedCustomScriptTypes);
    cleanerTimer.initTimer();
    statusCheckerDaily.initTimer();
    statusCheckerTimer.initTimer();
    logFileSizeChecker.initTimer();
    updateChecker.initTimer();
    transcodingRulesUpdater.initTimer();
    // Notify other components/plugins about finish application initialization
    eventApplicationInitialized.select(ApplicationInitialized.Literal.APPLICATION).fire(new ApplicationInitializedEvent());
}
Also used : PersistenceEntryManager(org.gluu.persist.PersistenceEntryManager) ApplicationInitializedEvent(org.gluu.service.cdi.event.ApplicationInitializedEvent) CustomScriptType(org.gluu.model.custom.script.CustomScriptType)

Example 2 with ApplicationInitializedEvent

use of org.gluu.service.cdi.event.ApplicationInitializedEvent in project oxAuth by GluuFederation.

the class AppInitializer method applicationInitialized.

public void applicationInitialized(@Observes @Initialized(ApplicationScoped.class) Object init) {
    log.debug("Initializing application services");
    configurationFactory.create();
    PersistenceEntryManager localPersistenceEntryManager = persistenceEntryManagerInstance.get();
    log.trace("Attempting to use {}: {}", ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME, localPersistenceEntryManager.getOperationService());
    GluuConfiguration newConfiguration = loadConfiguration(localPersistenceEntryManager, "oxIDPAuthentication", "oxAuthenticationMode");
    this.persistenceAuthConfigs = loadPersistenceAuthConfigs(newConfiguration);
    // Initialize python interpreter
    pythonService.initPythonInterpreter(configurationFactory.getBaseConfiguration().getString("pythonModulesDir", null));
    // Initialize script manager
    List<CustomScriptType> supportedCustomScriptTypes = Lists.newArrayList(CustomScriptType.values());
    supportedCustomScriptTypes.remove(CustomScriptType.CACHE_REFRESH);
    supportedCustomScriptTypes.remove(CustomScriptType.UPDATE_USER);
    supportedCustomScriptTypes.remove(CustomScriptType.USER_REGISTRATION);
    supportedCustomScriptTypes.remove(CustomScriptType.SCIM);
    supportedCustomScriptTypes.remove(CustomScriptType.IDP);
    statService.init();
    // Start timer
    initSchedulerService();
    // Schedule timer tasks
    metricService.initTimer();
    configurationFactory.initTimer();
    loggerService.initTimer();
    ldapStatusTimer.initTimer();
    cleanerTimer.initTimer();
    customScriptManager.initTimer(supportedCustomScriptTypes);
    keyGeneratorTimer.initTimer();
    statTimer.initTimer();
    expirationNotificatorTimer.initTimer();
    initTimer();
    initCibaRequestsProcessor();
    // Set default authentication method after
    setDefaultAuthenticationMethod(newConfiguration);
    // Notify plugins about finish application initialization
    eventApplicationInitialized.select(ApplicationInitialized.Literal.APPLICATION).fire(new ApplicationInitializedEvent());
}
Also used : PersistenceEntryManager(org.gluu.persist.PersistenceEntryManager) ApplicationInitializedEvent(org.gluu.service.cdi.event.ApplicationInitializedEvent) CustomScriptType(org.gluu.model.custom.script.CustomScriptType) GluuConfiguration(org.oxauth.persistence.model.configuration.GluuConfiguration)

Aggregations

CustomScriptType (org.gluu.model.custom.script.CustomScriptType)2 PersistenceEntryManager (org.gluu.persist.PersistenceEntryManager)2 ApplicationInitializedEvent (org.gluu.service.cdi.event.ApplicationInitializedEvent)2 GluuConfiguration (org.oxauth.persistence.model.configuration.GluuConfiguration)1