Examples of SSLIOSession


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

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

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

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

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

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

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

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

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

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

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

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

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

    public void connected(final IOSession session) {
      try {
            SSLIOSession sslSession = createSSLIOSession(
                    session,
                    this.sslcontext,
                    this.sslHandler);

            NHttpServerIOTarget conn = createConnection(
                    sslSession);

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

            this.handler.connected(conn);

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

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

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

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

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

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

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

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

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

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

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

        this(handler, sslcontext, null, params);
    }

    public void connected(final IOSession session) {

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

        LoggingNHttpServerConnection conn = new LoggingNHttpServerConnection(
                new LoggingIOSession(sslSession),
                new DefaultHttpRequestFactory(),
                new HeapByteBufferAllocator(),
                this.params);

        session.setAttribute(NHTTP_CONN, conn);
        session.setAttribute(SSL_SESSION, sslSession);

        this.handler.connected(conn);

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

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

    }

    public void inputReady(final IOSession session) {
        DefaultNHttpServerConnection conn = (DefaultNHttpServerConnection) session.getAttribute(
                NHTTP_CONN);
        SSLIOSession sslSession = (SSLIOSession) session.getAttribute(
                SSL_SESSION);
        try {
            synchronized (sslSession) {
                if (sslSession.isAppInputReady()) {
                    conn.consumeInput(this.handler);
                }
                sslSession.inboundTransport();
            }
        } catch (IOException ex) {
            this.handler.exception(conn, ex);
            sslSession.shutdown();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.