org.eclipse.jetty.server.session.HashSessionManager Java Examples

The following examples show how to use org.eclipse.jetty.server.session.HashSessionManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestServerUtil.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
  ServletContextHandler contextHandler = new ServletContextHandler();
  WebConfigurer configurer = new WebConfigurer();
  configurer.setContext(context);
  contextHandler.addEventListener(configurer);

  // Create the SessionHandler (wrapper) to handle the sessions
  HashSessionManager manager = new HashSessionManager();
  SessionHandler sessions = new SessionHandler(manager);
  contextHandler.setHandler(sessions);

  return contextHandler;
}
 
Example #2
Source File: BaseJPARestTestCase.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
  ServletContextHandler contextHandler = new ServletContextHandler();
  JPAWebConfigurer configurer = new JPAWebConfigurer();
  configurer.setContext(context);
  contextHandler.addEventListener(configurer);

  // Create the SessionHandler (wrapper) to handle the sessions
  HashSessionManager manager = new HashSessionManager();
  SessionHandler sessions = new SessionHandler(manager);
  contextHandler.setHandler(sessions);

  return contextHandler;
}
 
Example #3
Source File: TestServerUtil.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
  ServletContextHandler contextHandler = new ServletContextHandler();
  WebConfigurer configurer = new WebConfigurer();
  configurer.setContext(context);
  contextHandler.addEventListener(configurer);
  
  // Create the SessionHandler (wrapper) to handle the sessions
  HashSessionManager manager = new HashSessionManager();
  SessionHandler sessions = new SessionHandler(manager);
  contextHandler.setHandler(sessions);
  
  return contextHandler;
}
 
Example #4
Source File: TestServerUtil.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
    ServletContextHandler contextHandler = new ServletContextHandler();
    WebConfigurer configurer = new WebConfigurer();
    configurer.setContext(context);
    contextHandler.addEventListener(configurer);

    // Create the SessionHandler (wrapper) to handle the sessions
    HashSessionManager manager = new HashSessionManager();
    SessionHandler sessions = new SessionHandler(manager);
    contextHandler.setHandler(sessions);

    return contextHandler;
}
 
Example #5
Source File: TestServerUtil.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
    ServletContextHandler contextHandler = new ServletContextHandler();
    WebConfigurer configurer = new WebConfigurer();
    configurer.setContext(context);
    contextHandler.addEventListener(configurer);

    // Create the SessionHandler (wrapper) to handle the sessions
    HashSessionManager manager = new HashSessionManager();
    SessionHandler sessions = new SessionHandler(manager);
    contextHandler.setHandler(sessions);

    return contextHandler;
}
 
Example #6
Source File: TestServerUtil.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
    ServletContextHandler contextHandler = new ServletContextHandler();
    WebConfigurer configurer = new WebConfigurer();
    configurer.setContext(context);
    contextHandler.addEventListener(configurer);

    // Create the SessionHandler (wrapper) to handle the sessions
    HashSessionManager manager = new HashSessionManager();
    SessionHandler sessions = new SessionHandler(manager);
    contextHandler.setHandler(sessions);

    return contextHandler;
}
 
Example #7
Source File: TestServerUtil.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
    ServletContextHandler contextHandler = new ServletContextHandler();
    WebConfigurer configurer = new WebConfigurer();
    configurer.setContext(context);
    contextHandler.addEventListener(configurer);

    // Create the SessionHandler (wrapper) to handle the sessions
    HashSessionManager manager = new HashSessionManager();
    SessionHandler sessions = new SessionHandler(manager);
    contextHandler.setHandler(sessions);

    return contextHandler;
}
 
Example #8
Source File: TestServerUtil.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
    ServletContextHandler contextHandler = new ServletContextHandler();
    WebConfigurer configurer = new WebConfigurer();
    configurer.setContext(context);
    contextHandler.addEventListener(configurer);

    // Create the SessionHandler (wrapper) to handle the sessions
    HashSessionManager manager = new HashSessionManager();
    SessionHandler sessions = new SessionHandler(manager);
    contextHandler.setHandler(sessions);

    return contextHandler;
}
 
Example #9
Source File: TestServerUtil.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
private static ServletContextHandler getServletContextHandler(AnnotationConfigWebApplicationContext context) throws IOException {
    ServletContextHandler contextHandler = new ServletContextHandler();
    WebConfigurer configurer = new WebConfigurer();
    configurer.setContext(context);
    contextHandler.addEventListener(configurer);

    // Create the SessionHandler (wrapper) to handle the sessions
    HashSessionManager manager = new HashSessionManager();
    SessionHandler sessions = new SessionHandler(manager);
    contextHandler.setHandler(sessions);

    return contextHandler;
}
 
Example #10
Source File: ServerRpcProvider.java    From swellrt with Apache License 2.0 5 votes vote down vote up
private void restoreSessions() {
  try {
    HashSessionManager hashSessionManager = (HashSessionManager) jettySessionManager;
    hashSessionManager.setStoreDirectory(
        FileUtils.createDirIfNotExists(sessionStoreDir, "Session persistence"));
    hashSessionManager.setSavePeriod(60);
    hashSessionManager.restoreSessions();
  } catch (Exception e) {
    LOG.warning("Cannot restore sessions");
  }
}
 
Example #11
Source File: ServerRpcProvider.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
private void restoreSessions() {
  try {
    HashSessionManager hashSessionManager = (HashSessionManager) jettySessionManager;
    hashSessionManager.setStoreDirectory(FileUtils.createDirIfNotExists(sessionStoreDir,
        "Session persistence"));
    hashSessionManager.setSavePeriod(60);
    hashSessionManager.restoreSessions();
  } catch (Exception e) {
    LOG.warning("Cannot restore sessions");
  }
}
 
Example #12
Source File: ServerModule.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
@Provides
@Singleton
public org.eclipse.jetty.server.SessionManager provideSessionManager(Config config) {
  HashSessionManager sessionManager = new HashSessionManager();
  sessionManager.getSessionCookieConfig().setMaxAge(config.getInt("network.session_cookie_max_age"));
  return sessionManager;
}
 
Example #13
Source File: ServerModule.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@Provides
@Singleton
public org.eclipse.jetty.server.SessionManager provideSessionManager(Config config) {
  HashSessionManager sessionManager = new HashSessionManager();
  return sessionManager;
}