Package org.apache.http.impl.nio.reactor

Examples of org.apache.http.impl.nio.reactor.SSLIOSession


    }

    public void inputReady(final IOSession session) {
        final NHttpServerIOTarget conn =
            (NHttpServerIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
        final SSLIOSession sslSession =
            (SSLIOSession) session.getAttribute(SSL_SESSION);

        try {
            if (sslSession.isAppInputReady()) {
                conn.consumeInput(this.handler);
            }
            sslSession.inboundTransport();
        } catch (final IOException ex) {
            this.handler.exception(conn, ex);
            sslSession.shutdown();
        }
    }
View Full Code Here


    }

    public void outputReady(final IOSession session) {
        final NHttpServerIOTarget conn =
            (NHttpServerIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
        final SSLIOSession sslSession =
            (SSLIOSession) session.getAttribute(SSL_SESSION);

        try {
            if (sslSession.isAppOutputReady()) {
                conn.produceOutput(this.handler);
            }
            sslSession.outboundTransport();
        } catch (final IOException ex) {
            this.handler.exception(conn, ex);
            sslSession.shutdown();
        }
    }
View Full Code Here

    }

    public void timeout(final IOSession session) {
        final NHttpServerIOTarget conn =
            (NHttpServerIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
        final SSLIOSession sslSession =
            (SSLIOSession) session.getAttribute(SSL_SESSION);

        this.handler.timeout(conn);
        synchronized (sslSession) {
            if (sslSession.isOutboundDone() && !sslSession.isInboundDone()) {
                // The session failed to cleanly terminate
                sslSession.shutdown();
            }
        }
    }
View Full Code Here

     */
    protected SSLIOSession createSSLIOSession(
            final IOSession session,
            final SSLContext sslcontext,
            final SSLSetupHandler sslHandler) {
        return new SSLIOSession(session, sslcontext, sslHandler);
    }
View Full Code Here

        return super.createConnection(ssliosession);
    }

    @Override
    protected NHttpClientIOTarget createConnection(final IOSession session) {
        final SSLIOSession ssliosession = createSSLIOSession(session, this.sslcontext, this.sslHandler);
        session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
        final NHttpClientIOTarget conn = createSSLConnection(ssliosession);
        try {
            ssliosession.initialize();
        } catch (final SSLException ex) {
            this.handler.exception(conn, ex);
            ssliosession.shutdown();
        }
        return conn;
    }
View Full Code Here

     */
    protected SSLIOSession createSSLIOSession(
            final IOSession session,
            final SSLContext sslcontext,
            final SSLSetupHandler sslHandler) {
        return new SSLIOSession(session, sslcontext, sslHandler);
    }
View Full Code Here

        return super.createConnection(ssliosession);
    }

    @Override
    protected NHttpServerIOTarget createConnection(final IOSession session) {
        final SSLIOSession ssliosession = createSSLIOSession(session, this.sslcontext, this.sslHandler);
        session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
        final NHttpServerIOTarget conn = createSSLConnection(ssliosession);
        try {
            ssliosession.initialize();
        } catch (final SSLException ex) {
            this.handler.exception(conn, ex);
            ssliosession.shutdown();
        }
        return conn;
    }
View Full Code Here

     */
    protected SSLIOSession createSSLIOSession(
            final IOSession session,
            final SSLContext sslcontext,
            final SSLIOSessionHandler sslHandler) {
        return new SSLIOSession(session, sslcontext, sslHandler);
    }
View Full Code Here

        return new SSLIOSession(session, sslcontext, sslHandler);
    }

    public void connected(final IOSession session) {

        final SSLIOSession sslSession = createSSLIOSession(
                session,
                this.sslcontext,
                this.sslHandler);

        final NHttpClientIOTarget conn = createConnection(
                sslSession);

        session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
        session.setAttribute(SSL_SESSION, sslSession);

        final Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
        this.handler.connected(conn, attachment);

        try {
            sslSession.bind(SSLMode.CLIENT, this.params);
        } catch (final SSLException ex) {
            this.handler.exception(conn, ex);
            sslSession.shutdown();
        }
    }
View Full Code Here

    }

    public void inputReady(final IOSession session) {
        final NHttpClientIOTarget conn =
            (NHttpClientIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
        final SSLIOSession sslSession =
            (SSLIOSession) session.getAttribute(SSL_SESSION);

        try {
            if (sslSession.isAppInputReady()) {
                conn.consumeInput(this.handler);
            }
            sslSession.inboundTransport();
        } catch (final IOException ex) {
            this.handler.exception(conn, ex);
            sslSession.shutdown();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.http.impl.nio.reactor.SSLIOSession

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.