org.eclipse.jetty.server.Server.setSessionIdManager()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中org.eclipse.jetty.server.Server.setSessionIdManager()方法的一些代码示例,展示了Server.setSessionIdManager()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.setSessionIdManager()方法的具体详情如下:
包路径:org.eclipse.jetty.server.Server
类名称:Server
方法名:setSessionIdManager

Server.setSessionIdManager介绍

暂无

代码示例

代码示例来源:origin: jphp-group/jphp

private void initSessionManager() {
  idmanager = new DefaultSessionIdManager(server);
  server.setSessionIdManager(idmanager);
  SessionHandler sessions = new SessionHandler();
  sessions.setSessionIdManager(idmanager);
  filters.addHandler(sessions);
}

代码示例来源:origin: line/armeria

config.requestLog().ifPresent(server::setRequestLog);
config.sessionIdManagerFactory().ifPresent(
    factory -> server.setSessionIdManager(factory.apply(server)));

代码示例来源:origin: loklak/loklak_server

LoklakServer.server.setSessionIdManager(idmanager);
SessionHandler sessions = new SessionHandler(new HashSessionManager());
sessions.setHandler(gzipHandler);

代码示例来源:origin: loklak/loklak_server

LoklakInstallation.server.setSessionIdManager(idmanager);
SessionHandler sessions = new SessionHandler(new HashSessionManager());
sessions.setHandler(gzipHandler);

代码示例来源:origin: stackoverflow.com

server.setSessionIdManager(idmanager);

代码示例来源:origin: cn.home1/oss-lib-webmvc-spring-boot-1.4.2.RELEASE

@Override
 public void customize(final Server server) {
  server.setSessionIdManager(null);
 }
}

代码示例来源:origin: cn.home1/oss-lib-webmvc-spring-boot-1.4.1.RELEASE

@Override
 public void customize(final Server server) {
  server.setSessionIdManager(null);
 }
}

代码示例来源:origin: stackoverflow.com

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.session.HashSessionIdManager;
import org.eclipse.jetty.server.session.JDBCSessionManager;

public class ScoopSessionManager extends JDBCSessionManager {

  @Override
  public void doStart() throws Exception {
    final Server server = getSessionHandler().getServer();
    _sessionIdManager = server.getSessionIdManager();
    if (_sessionIdManager == null) {
      _sessionIdManager = new HashSessionIdManager();
      server.setSessionIdManager(_sessionIdManager);
    }
    super.doStart();
  }
}

代码示例来源:origin: org.eclipse.jetty.tests/test-sessions-common

public TestServer(int port, int maxInactivePeriod, int scavengePeriod,  SessionCacheFactory cacheFactory, SessionDataStoreFactory storeFactory) throws Exception
{
  _server = new Server(port);
  _maxInactivePeriod = maxInactivePeriod;
  _scavengePeriod = scavengePeriod;
  _cacheFactory = cacheFactory;
  _storeFactory = storeFactory;
  _contexts = new ContextHandlerCollection();
  _sessionIdManager = newSessionIdManager();
  _server.setSessionIdManager(_sessionIdManager);
  ((DefaultSessionIdManager) _sessionIdManager).setServer(_server);
  _housekeeper = new HouseKeeper();
  _housekeeper.setIntervalSec(_scavengePeriod);
  ((DefaultSessionIdManager)_sessionIdManager).setSessionHouseKeeper(_housekeeper);
}

代码示例来源:origin: com.expanset.jersey/jersey-jetty

this.server.setSessionIdManager(serverSettings.getSessionIdManager());

代码示例来源:origin: org.codehaus.fabric3/fabric3-jetty

private void initializeHandlers() {
  statisticsHandler = new ManagedStatisticsHandler();
  if (logFilename != null) {
    RequestLogHandler requestLogHandler = createLogHandler();
    server.setHandler(requestLogHandler);
  } else {
    server.setHandler(statisticsHandler);
  }
  ExecutionContextHandler executionHandler = new ExecutionContextHandler();
  statisticsHandler.setHandler(executionHandler);
  rootHandler = new ContextHandlerCollection();
  executionHandler.setHandler(rootHandler);
  contextHandler = new ServletContextHandler(rootHandler, ROOT);
  sessionManager = new ManagedHashSessionManager();
  HashSessionIdManager sessionIdManager = new HashSessionIdManager();
  String workerName = hostInfo.getRuntimeName().replace(".", "_"); // Jetty does not accept names with '.' characters
  sessionIdManager.setWorkerName(workerName);
  server.setSessionIdManager(sessionIdManager);
  sessionManager.setIdManager(sessionIdManager);
  SessionHandler sessionHandler = new SessionHandler(sessionManager);
  servletHandler = new ManagedServletHandler();
  sessionHandler.setHandler(servletHandler);
  contextHandler.setHandler(sessionHandler);
  try {
    statisticsHandler.start();
    statisticsHandler.startStatisticsCollection();
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

server.setSessionIdManager(_sessionIdManager);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

server.setSessionIdManager(_sessionIdManager);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

server.setSessionIdManager(_sessionIdManager);

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

server.setSessionIdManager(_sessionIdManager);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

server.setSessionIdManager(_sessionIdManager);

代码示例来源:origin: org.eclipse.jetty/server

server.setSessionIdManager(_sessionIdManager);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

server.setSessionIdManager(_sessionIdManager);

代码示例来源:origin: org.fabric3/fabric3-jetty

String workerName = hostInfo.getRuntimeName().replace(".", "_"); // Jetty does not accept names with '.' characters
sessionIdManager.setWorkerName(workerName);
server.setSessionIdManager(sessionIdManager);
SessionHandler sessionHandler = new SessionHandler(sessionManager);
servletHandler = new ManagedServletHandler();

代码示例来源:origin: apache/tapestry-5

private JettyRunner configureClusteredJetty(String name, int port) throws Exception
{
  JettyRunner runner = new JettyRunner();
  runner.configure("src/test/cluster", "", port, port + 100);
  JDBCSessionIdManager idMgr = new JDBCSessionIdManager(runner.getServer());
  idMgr.setWorkerName(name);
  idMgr.setDriverInfo("org.hsqldb.jdbcDriver", "jdbc:hsqldb:mem:clustertest");
  Server server = runner.getServer();
  server.setSessionIdManager(idMgr);
  WebAppContext wac = (WebAppContext) server.getHandler();
  JDBCSessionManager jdbcMgr = new JDBCSessionManager();
  jdbcMgr.setIdManager(server.getSessionIdManager());
  // force the session to be read from the database with no delay
  // This is an incorrectly documented feature.
  jdbcMgr.setSaveInterval(0);
  wac.setSessionHandler(new SessionHandler(jdbcMgr));
  wac.getServletContext().setInitParameter("cluster.name", name);
  runner.start();
  return runner;
}

相关文章