Package io.undertow.server.session

Examples of io.undertow.server.session.InMemorySessionManager


    @Test
    public void testSslSession() throws IOException {
        TestHttpClient client = new TestHttpClient();
        try {
            InMemorySessionManager sessionManager = new InMemorySessionManager("");
            final SslSessionConfig sessionConfig = new SslSessionConfig(sessionManager);
            final SessionAttachmentHandler handler = new SessionAttachmentHandler(sessionManager, sessionConfig)
                    .setNext(new HttpHandler() {
                        @Override
                        public void handleRequest(final HttpServerExchange exchange) throws Exception {
View Full Code Here


    public static final String COUNT = "count";

    @BeforeClass
    public static void setup() {
        final PathParameterSessionConfig sessionConfig = new PathParameterSessionConfig();
        final SessionAttachmentHandler handler = new SessionAttachmentHandler(new InMemorySessionManager(""), sessionConfig);
        handler.setNext(new HttpHandler() {
            @Override
            public void handleRequest(final HttpServerExchange exchange) throws Exception {
                final SessionManager manager = exchange.getAttachment(SessionManager.ATTACHMENT_KEY);
                Session session = manager.getSession(exchange, sessionConfig);
View Full Code Here

        final SessionCookieConfig sessionConfig = new SessionCookieConfig();
        int port = DefaultServer.getHostPort("default");
        server1 = Undertow.builder()
                .addListener(port + 1, DefaultServer.getHostAddress("default"))
                .setHandler(jvmRoute("JSESSIONID", "s1", path()
                        .addPrefixPath("/session", new SessionAttachmentHandler(new SessionTestHandler(sessionConfig), new InMemorySessionManager(""), sessionConfig))
                        .addPrefixPath("/name", new StringSendHandler("server1"))))
                .build();

        server2 = Undertow.builder()
                .addListener(port + 2, DefaultServer.getHostAddress("default"))
                .setHandler(jvmRoute("JSESSIONID", "s2", path()
                        .addPrefixPath("/session", new SessionAttachmentHandler(new SessionTestHandler(sessionConfig), new InMemorySessionManager(""), sessionConfig))
                        .addPrefixPath("/name", new StringSendHandler("server2"))))
                .build();
        server1.start();
        server2.start();
View Full Code Here

TOP

Related Classes of io.undertow.server.session.InMemorySessionManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.