Package org.apache.http.nio

Examples of org.apache.http.nio.NHttpClientIOTarget


            throw ex;
        }
    }

    public void disconnected(final IOSession session) {
        NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
                ExecutionContext.HTTP_CONNECTION);
        if (conn != null) {
            this.handler.closed(conn);
        }
    }
View Full Code Here


        }
    }

    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();
View Full Code Here

        }
    }

    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();
View Full Code Here

        }
    }

    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);
View Full Code Here

        }
    }

    public void connected(final IOSession session) {
        try {
            NHttpClientIOTarget conn = createConnection(session);
            Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
            session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);

            int timeout = HttpConnectionParams.getSoTimeout(this.params);
            conn.setSocketTimeout(timeout);

            this.handler.connected(conn, attachment);
        } catch (RuntimeException ex) {
            session.shutdown();
            throw ex;
View Full Code Here

            throw ex;
        }
    }

    public void disconnected(final IOSession session) {
        NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
                ExecutionContext.HTTP_CONNECTION);
        if (conn != null) {
            this.handler.closed(conn);
        }
    }
View Full Code Here

        }
    }

    public void inputReady(final IOSession session) {
        try {
            NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
                    ExecutionContext.HTTP_CONNECTION);
            ensureNotNull(conn);
            conn.consumeInput(this.handler);
        } catch (RuntimeException ex) {
            session.shutdown();
            throw ex;
        }
    }
View Full Code Here

        }
    }

    public void outputReady(final IOSession session) {
        try {
            NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
                    ExecutionContext.HTTP_CONNECTION);
            ensureNotNull(conn);
            conn.produceOutput(this.handler);
        } catch (RuntimeException ex) {
            session.shutdown();
            throw ex;
        }
    }
View Full Code Here

        }
    }

    public void timeout(final IOSession session) {
        try {
            NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
                    ExecutionContext.HTTP_CONNECTION);
            ensureNotNull(conn);
            this.handler.timeout(conn);
        } catch (RuntimeException ex) {
            session.shutdown();
View Full Code Here

                this.allocator,
                this.params);
    }
       
    public void connected(final IOSession session) {
        NHttpClientIOTarget conn = createConnection(session);
        Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
        session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
        this.handler.connected(conn, attachment);
    }
View Full Code Here

TOP

Related Classes of org.apache.http.nio.NHttpClientIOTarget

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.