Search in sources :

Example 16 with SessionConfig

use of io.undertow.server.session.SessionConfig in project wildfly by wildfly.

the class DistributableSession method invalidate.

@Override
public void invalidate(HttpServerExchange exchange) {
    Map.Entry<Session<LocalSessionContext>, SessionConfig> entry = this.entry;
    Session<LocalSessionContext> session = entry.getKey();
    validate(session);
    // Invoke listeners outside of the context of the batch associated with this session
    this.manager.getSessionListeners().sessionDestroyed(this, exchange, SessionDestroyedReason.INVALIDATED);
    try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
        session.invalidate();
        if (exchange != null) {
            String id = session.getId();
            entry.getValue().clearSession(exchange, id);
        }
        this.batch.close();
    } finally {
        this.closeTask.run();
    }
}
Also used : SessionConfig(io.undertow.server.session.SessionConfig) BatchContext(org.wildfly.clustering.ee.BatchContext) Map(java.util.Map) Session(org.wildfly.clustering.web.session.Session) AuthenticatedSession(io.undertow.security.api.AuthenticatedSessionManager.AuthenticatedSession)

Aggregations

SessionConfig (io.undertow.server.session.SessionConfig)16 HttpServerExchange (io.undertow.server.HttpServerExchange)10 Test (org.junit.Test)8 SessionManager (io.undertow.server.session.SessionManager)6 Batch (org.wildfly.clustering.ee.Batch)6 Session (io.undertow.server.session.Session)5 AuthenticatedSession (io.undertow.security.api.AuthenticatedSessionManager.AuthenticatedSession)3 PathParameterSessionConfig (io.undertow.server.session.PathParameterSessionConfig)2 SslSessionConfig (io.undertow.server.session.SslSessionConfig)2 Map (java.util.Map)2 BatchContext (org.wildfly.clustering.ee.BatchContext)2 Undertow (io.undertow.Undertow)1 AuthenticatedSessionManager (io.undertow.security.api.AuthenticatedSessionManager)1 SecurityContext (io.undertow.security.api.SecurityContext)1 HttpHandler (io.undertow.server.HttpHandler)1 PathHandler (io.undertow.server.handlers.PathHandler)1 InMemorySessionManager (io.undertow.server.session.InMemorySessionManager)1 SessionAttachmentHandler (io.undertow.server.session.SessionAttachmentHandler)1 SessionCookieConfig (io.undertow.server.session.SessionCookieConfig)1 SessionListener (io.undertow.server.session.SessionListener)1