Java Code Examples for org.eclipse.jetty.server.session.DefaultSessionIdManager

Following code examples demonstrate how to use org.eclipse.jetty.server.session.DefaultSessionIdManager from jetty. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.eclipse.jetty.server.session.DefaultSessionIdManager and various code implementation of this class.
Example 1
Project : jetty Source File : ClusteredSessionHandlerProvider.java View Source Code on GitHub

  public SessionHandler createSessionHandler( Server server ) {
    SessionHandler handler = new SessionHandler();
    DefaultSessionCache sessionCache = new DefaultSessionCache( handler );
    JDBCSessionDataStore sessionDataStore = new JDBCSessionDataStore();
    sessionCache.setSessionDataStore( sessionDataStore );
    DatabaseAdaptor databaseAdaptor = new DatabaseAdaptor();
    databaseAdaptor.setDriverInfo( databaseServer.getDriver(), databaseServer.getConnectionUrl() );
    sessionDataStore.setDatabaseAdaptor( databaseAdaptor );
    DefaultSessionIdManager sessionIdManager = new CleanJDBCSessionIdManager( server );
    sessionIdManager.setWorkerName( generateNodeName() );
    handler.setSessionCache( sessionCache );
    handler.setSessionIdManager( sessionIdManager );
    return handler;
  }
			
Example 2
Project : jetty Source File : SessionHandlerProvider.java View Source Code on GitHub

  public SessionHandler createSessionHandler( Server server ) throws Exception {
    SessionHandler handler = new SessionHandler();
    DefaultSessionCache sessionCache = new DefaultSessionCache( handler );
    NullSessionDataStore sessionDataStore = new NullSessionDataStore();
    sessionCache.setSessionDataStore( sessionDataStore );
    DefaultSessionIdManager sessionIdManager = new DefaultSessionIdManager( server );
    HouseKeeper houseKeeper = new HouseKeeper();
    houseKeeper.setIntervalSec( SCAVENGE_INTERVAL );
    sessionIdManager.setSessionHouseKeeper( houseKeeper );
    handler.setSessionCache( sessionCache );
    handler.setSessionIdManager( sessionIdManager );
    return handler;
  }