类org.eclipse.jetty.server.session.HashSessionIdManager源码实例Demo

下面列出了怎么用org.eclipse.jetty.server.session.HashSessionIdManager的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: activiti6-boot2   文件: TestServerUtil.java
public static TestServer createAndStartServer(Class<?>... configClasses) {
  int port = NEXT_PORT.incrementAndGet();
  Server server = new Server(port);

  HashSessionIdManager idmanager = new HashSessionIdManager();
  server.setSessionIdManager(idmanager);

  AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
  applicationContext.register(configClasses);
  applicationContext.refresh();

  try {
    server.setHandler(getServletContextHandler(applicationContext));
    server.start();
  } catch (Exception e) {
    log.error("Error starting server", e);
  }

  return new TestServer(server, applicationContext, port);
}
 
源代码2 项目: activiti6-boot2   文件: BaseJPARestTestCase.java
public static void createAndStartServer() {
  server = new Server(HTTP_SERVER_PORT);

  HashSessionIdManager idmanager = new HashSessionIdManager();
  server.setSessionIdManager(idmanager);

  AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
  applicationContext.register(JPAApplicationConfiguration.class);
  applicationContext.refresh();

  appContext = applicationContext;

  try {
    server.setHandler(getServletContextHandler(applicationContext));
    server.start();
  } catch (Exception e) {
    log.error("Error starting server", e);
  }
}
 
源代码3 项目: activiti6-boot2   文件: TestServerUtil.java
public static TestServer createAndStartServer(Class<?> ... configClasses) {
	int port= NEXT_PORT.incrementAndGet();
  Server server = new Server(port);

  HashSessionIdManager idmanager = new HashSessionIdManager();
  server.setSessionIdManager(idmanager);
  
  AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
  applicationContext.register(configClasses);
  applicationContext.refresh();
    
  try {
    server.setHandler(getServletContextHandler(applicationContext));
    server.start();
  } catch (Exception e) {
    log.error("Error starting server", e);
  }
  
  return new TestServer(server, applicationContext, port);
}
 
源代码4 项目: flowable-engine   文件: TestServerUtil.java
public static TestServer createAndStartServer(Class<?>... configClasses) {
    int port = NEXT_PORT.incrementAndGet();
    Server server = new Server(port);

    HashSessionIdManager idmanager = new HashSessionIdManager();
    server.setSessionIdManager(idmanager);

    AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
    applicationContext.register(configClasses);
    applicationContext.refresh();

    try {
        server.setHandler(getServletContextHandler(applicationContext));
        server.start();
    } catch (Exception e) {
        LOGGER.error("Error starting server", e);
    }

    return new TestServer(server, applicationContext, port);
}
 
源代码5 项目: flowable-engine   文件: TestServerUtil.java
public static TestServer createAndStartServer(Class<?>... configClasses) {
    int port = NEXT_PORT.incrementAndGet();
    Server server = new Server(port);

    HashSessionIdManager idmanager = new HashSessionIdManager();
    server.setSessionIdManager(idmanager);

    AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
    applicationContext.register(configClasses);
    applicationContext.refresh();

    try {
        server.setHandler(getServletContextHandler(applicationContext));
        server.start();
    } catch (Exception e) {
        LOGGER.error("Error starting server", e);
    }

    return new TestServer(server, applicationContext, port);
}
 
源代码6 项目: flowable-engine   文件: TestServerUtil.java
public static TestServer createAndStartServer(Class<?>... configClasses) {
    int port = NEXT_PORT.incrementAndGet();
    Server server = new Server(port);

    HashSessionIdManager idmanager = new HashSessionIdManager();
    server.setSessionIdManager(idmanager);

    AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
    applicationContext.register(configClasses);
    applicationContext.refresh();

    try {
        server.setHandler(getServletContextHandler(applicationContext));
        server.start();
    } catch (Exception e) {
        LOGGER.error("Error starting server", e);
    }

    return new TestServer(server, applicationContext, port);
}
 
源代码7 项目: flowable-engine   文件: TestServerUtil.java
public static TestServer createAndStartServer(Class<?>... configClasses) {
    int port = NEXT_PORT.incrementAndGet();
    Server server = new Server(port);

    HashSessionIdManager idmanager = new HashSessionIdManager();
    server.setSessionIdManager(idmanager);

    AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
    applicationContext.register(configClasses);
    applicationContext.refresh();

    try {
        server.setHandler(getServletContextHandler(applicationContext));
        server.start();
    } catch (Exception e) {
        LOGGER.error("Error starting server", e);
    }

    return new TestServer(server, applicationContext, port);
}
 
源代码8 项目: flowable-engine   文件: TestServerUtil.java
public static TestServer createAndStartServer(Class<?>... configClasses) {
    int port = NEXT_PORT.incrementAndGet();
    Server server = new Server(port);

    HashSessionIdManager idmanager = new HashSessionIdManager();
    server.setSessionIdManager(idmanager);

    AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
    applicationContext.register(configClasses);
    applicationContext.refresh();

    try {
        server.setHandler(getServletContextHandler(applicationContext));
        server.start();
    } catch (Exception e) {
        LOGGER.error("Error starting server", e);
    }

    return new TestServer(server, applicationContext, port);
}
 
源代码9 项目: flowable-engine   文件: TestServerUtil.java
public static TestServer createAndStartServer(Class<?>... configClasses) {
    int port = NEXT_PORT.incrementAndGet();
    Server server = new Server(port);

    HashSessionIdManager idmanager = new HashSessionIdManager();
    server.setSessionIdManager(idmanager);

    AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
    applicationContext.register(configClasses);
    applicationContext.refresh();

    try {
        server.setHandler(getServletContextHandler(applicationContext));
        server.start();
    } catch (Exception e) {
        LOGGER.error("Error starting server", e);
    }

    return new TestServer(server, applicationContext, port);
}
 
源代码10 项目: GeoTriples   文件: JettyLauncher.java
/**
 * Starts a Jetty server with D2R Server as root webapp.
 * 
 * @return <code>true</code> on success, <code>false</code> if webapp init failed 
 */
public boolean start() {
	Server jetty = new Server(port);

	// use Random (/dev/urandom) instead of SecureRandom to generate session keys - otherwise Jetty may hang during startup waiting for enough entropy
	// see http://jira.codehaus.org/browse/JETTY-331 and http://docs.codehaus.org/display/JETTY/Connectors+slow+to+startup
	jetty.setSessionIdManager(new HashSessionIdManager(new Random()));
	WebAppContext context = new WebAppContext(jetty, "webapp", "");

	// Wave a chicken at Jetty to make some annoying System.err.println noise go away
	context.getSecurityHandler().setIdentityService(new DefaultIdentityService());
	context.getSecurityHandler().setAuthenticator(null);
	context.getSecurityHandler().setAuthenticatorFactory(null);
	
	// Place the system loader into the servlet context. The webapp init
	// listener will find it there and create the D2RServer instance.
	D2RServer.storeSystemLoader(loader, context.getServletContext());
	try {
		jetty.start();
		D2RServer server = D2RServer.fromServletContext(context.getServletContext());
		if (server == null || server.errorOnStartup()) {
			jetty.stop();
			log.warn("[[[ Server startup failed, see messages above ]]]");
			return false;
		}
		log.info("[[[ Server started at " + loader.getSystemBaseURI() + " ]]]");
		return true;
	} catch (Exception ex) {
		throw new RuntimeException(ex);
	}
}
 
 类所在包
 同包方法