final SecurityHandler securityHandler) { SessionManager sessionManager = new HashSessionManager(); sessionManager.setMaxInactiveInterval( config.getInt(DrillOnYarnConfig.HTTP_SESSION_MAX_IDLE_SECS)); sessionManager.addEventListener(new HttpSessionListener() {
SessionManager sessionManager = new HashSessionManager(); sessionManager.setMaxInactiveInterval(60 * 15); //session time out of 15 minutes HashSessionIdManager idManager = new HashSessionIdManager(); sessionManager.getSessionCookieConfig().setName("JSESSIONID_" + Integer.toString(m_serverSettings.getM_webServerPort())); sessionManager.setSessionIdManager(idManager); SessionHandler sessionHandler = new SessionHandler(sessionManager);
public void start() throws Exception { server = new Server(port); WebAppContext webAppContext = new WebAppContext(); webAppContext.setContextPath("/"); webAppContext.setWar("zenvisage.war"); webAppContext.setParentLoaderPriority(true); webAppContext.setServer(server); webAppContext.setClassLoader(ClassLoader.getSystemClassLoader()); webAppContext.getSessionHandler().getSessionManager() .setMaxInactiveInterval(10); server.setHandler(webAppContext); server.start(); // ZvMain zvMain = (ZvMain) SpringApplicationContext.getBean("zvMain"); // zvMain.loadData(); DatabaseAutoLoader databaseAutoLoader = new DatabaseAutoLoader(this); databaseAutoLoader.run(); }
context.setContextPath("/"); context.getSessionHandler().getSessionManager().setMaxInactiveInterval(serverConfig.getSessionTimeout());
@Override protected void onInitialize() throws UnifyException { try { logInfo("Initializing HTTP server on port {0}; using context path {1} and servlet path {2}...", Integer.toString(getHttpPort()), getContextPath(), getServletPath()); httpServer = new Server(getHttpPort()); ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); context.setContextPath(getContextPath()); context.getSessionHandler().getSessionManager().setMaxInactiveInterval( getContainerSetting(int.class, UnifyCorePropertyConstants.APPLICATION_SESSION_TIMEOUT, UnifyContainer.DEFAULT_APPLICATION_SESSION_TIMEOUT)); httpServer.setHandler(context); ServletHolder mainHolder = new ServletHolder(createHttpServlet()); mainHolder.getRegistration().setMultipartConfig(new MultipartConfigElement(getMultipartLocation(), getMultipartMaxFileSize(), getMultipartMaxRequestSize(), getMultipartFileSizeThreshold())); context.addServlet(mainHolder, getServletPath()); httpServer.start(); logInfo("HTTP server initialization completed."); } catch (Exception e) { throw new UnifyException(e, UnifyCoreErrorConstants.COMPONENT_INITIALIZATION_ERROR, getName()); } }
webAppContext.getSessionHandler().getSessionManager().setMaxInactiveInterval(getSessionTimeout() * 60);
sessionManager.setMaxInactiveInterval(config.getInt(ExecConstants.HTTP_SESSION_MAX_IDLE_SECS));
context.getSessionHandler().getSessionManager().setMaxInactiveInterval(timeout * 60);
context.getSessionHandler().getSessionManager().setMaxInactiveInterval(timeout * 60);
context.getSessionHandler().getSessionManager().setMaxInactiveInterval(timeout * 60);
context.getSessionHandler().getSessionManager().setMaxInactiveInterval(timeout * 60);
context.getSessionHandler().getSessionManager().setMaxInactiveInterval(timeout * 60);