Search in sources :

Example 1 with DispatcherModule

use of org.olat.core.dispatcher.DispatcherModule in project openolat by klemens.

the class OpenOLATServlet method init.

/**
 * @see javax.servlet.Servlet#init(javax.servlet.ServletConfig)
 */
@Override
public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);
    requestBasedLogLevelManager = RequestBasedLogLevelManager.getInstance();
    if (requestBasedLogLevelManager == null) {
        log.info("init: RequestBasedLogLevelManager is not configured on this system.");
    } else {
        log.info("init: RequestBasedLogLevelManager is configured and will be used.");
    }
    if (UserBasedLogLevelManager.getInstance() == null) {
        log.info("init: UserBasedLogLevelManager is not configured on this system.");
    } else {
        log.info("init: UserBasedLogLevelManager is configured and will be used.");
    }
    // the servlet.init method gets called after the spring stuff and all the stuff in web.xml is done
    log.info("Framework has started, sending event to listeners of FrameworkStartupEventChannel");
    FrameworkStartupEventChannel.fireEvent();
    log.info("FrameworkStartupEvent processed by alle listeners. Webapp has started.");
    sessionStatsManager = CoreSpringFactory.getImpl(SessionStatsManager.class);
    DispatcherModule dispatcherModule = CoreSpringFactory.getImpl(DispatcherModule.class);
    dispatchers = new HashMap<>(dispatcherModule.getDispatchers());
    dispatchers.put(DispatcherModule.PATH_MAPPED, new MapperDispatcher());
    dispatchers.put(DispatcherModule.PATH_GLOBAL_MAPPED, GlobalMapperRegistry.getInstance());
    webDAVDispatcher = CoreSpringFactory.getImpl(WebDAVDispatcher.class);
    dispatchers.put(DispatcherModule.WEBDAV_PATH, webDAVDispatcher);
    Settings settings = CoreSpringFactory.getImpl(Settings.class);
    if (StringHelper.containsNonWhitespace(settings.getLegacyContext())) {
        legacyContext = settings.getLegacyContext();
        // same pattern as dispatcher: /olat/
        if (!legacyContext.startsWith("/")) {
            legacyContext = "/" + legacyContext;
        }
        if (!legacyContext.endsWith("/")) {
            legacyContext += "/";
        }
    }
    // preload extensions
    ExtManager.getInstance().getExtensions();
    AbstractSpringModule.printStats();
    preWarm();
}
Also used : DispatcherModule(org.olat.core.dispatcher.DispatcherModule) SessionStatsManager(org.olat.admin.sysinfo.manager.SessionStatsManager) Settings(org.olat.core.helpers.Settings) MapperDispatcher(org.olat.core.dispatcher.mapper.MapperDispatcher) WebDAVDispatcher(org.olat.core.commons.services.webdav.WebDAVDispatcher)

Example 2 with DispatcherModule

use of org.olat.core.dispatcher.DispatcherModule in project OpenOLAT by OpenOLAT.

the class OpenOLATServlet method init.

/**
 * @see javax.servlet.Servlet#init(javax.servlet.ServletConfig)
 */
@Override
public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);
    requestBasedLogLevelManager = RequestBasedLogLevelManager.getInstance();
    if (requestBasedLogLevelManager == null) {
        log.info("init: RequestBasedLogLevelManager is not configured on this system.");
    } else {
        log.info("init: RequestBasedLogLevelManager is configured and will be used.");
    }
    if (UserBasedLogLevelManager.getInstance() == null) {
        log.info("init: UserBasedLogLevelManager is not configured on this system.");
    } else {
        log.info("init: UserBasedLogLevelManager is configured and will be used.");
    }
    // the servlet.init method gets called after the spring stuff and all the stuff in web.xml is done
    log.info("Framework has started, sending event to listeners of FrameworkStartupEventChannel");
    FrameworkStartupEventChannel.fireEvent();
    log.info("FrameworkStartupEvent processed by alle listeners. Webapp has started.");
    sessionStatsManager = CoreSpringFactory.getImpl(SessionStatsManager.class);
    DispatcherModule dispatcherModule = CoreSpringFactory.getImpl(DispatcherModule.class);
    dispatchers = new HashMap<>(dispatcherModule.getDispatchers());
    dispatchers.put(DispatcherModule.PATH_MAPPED, new MapperDispatcher());
    dispatchers.put(DispatcherModule.PATH_GLOBAL_MAPPED, GlobalMapperRegistry.getInstance());
    webDAVDispatcher = CoreSpringFactory.getImpl(WebDAVDispatcher.class);
    dispatchers.put(DispatcherModule.WEBDAV_PATH, webDAVDispatcher);
    Settings settings = CoreSpringFactory.getImpl(Settings.class);
    if (StringHelper.containsNonWhitespace(settings.getLegacyContext())) {
        legacyContext = settings.getLegacyContext();
        // same pattern as dispatcher: /olat/
        if (!legacyContext.startsWith("/")) {
            legacyContext = "/" + legacyContext;
        }
        if (!legacyContext.endsWith("/")) {
            legacyContext += "/";
        }
    }
    // preload extensions
    ExtManager.getInstance().getExtensions();
    AbstractSpringModule.printStats();
    preWarm();
}
Also used : DispatcherModule(org.olat.core.dispatcher.DispatcherModule) SessionStatsManager(org.olat.admin.sysinfo.manager.SessionStatsManager) Settings(org.olat.core.helpers.Settings) MapperDispatcher(org.olat.core.dispatcher.mapper.MapperDispatcher) WebDAVDispatcher(org.olat.core.commons.services.webdav.WebDAVDispatcher)

Aggregations

SessionStatsManager (org.olat.admin.sysinfo.manager.SessionStatsManager)2 WebDAVDispatcher (org.olat.core.commons.services.webdav.WebDAVDispatcher)2 DispatcherModule (org.olat.core.dispatcher.DispatcherModule)2 MapperDispatcher (org.olat.core.dispatcher.mapper.MapperDispatcher)2 Settings (org.olat.core.helpers.Settings)2