hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1633171 - /httpcomponents/httpcore/trunk/src/docbkx/blocking-io.xml
Date Mon, 20 Oct 2014 15:25:53 GMT
Author: olegk
Date: Mon Oct 20 15:25:53 2014
New Revision: 1633171

URL: http://svn.apache.org/r1633171
Log:
Removed duplicate section

Modified:
    httpcomponents/httpcore/trunk/src/docbkx/blocking-io.xml

Modified: httpcomponents/httpcore/trunk/src/docbkx/blocking-io.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/src/docbkx/blocking-io.xml?rev=1633171&r1=1633170&r2=1633171&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/src/docbkx/blocking-io.xml (original)
+++ httpcomponents/httpcore/trunk/src/docbkx/blocking-io.xml Mon Oct 20 15:25:53 2014
@@ -220,194 +220,6 @@ conn.sendResponseEntity(response);
         </section>
     </section>
     <section>
-        <title>HTTP protocol processors</title>
-        <para>
-        HTTP protocol interceptor is a routine that implements a specific aspect of the HTTP
-        protocol. Usually protocol interceptors are expected to act upon one specific header
or a
-        group of related headers of the incoming message or populate the outgoing message
with one
-        specific header or a group of related headers. Protocol interceptors can also manipulate
-        content entities enclosed with messages; transparent content compression / decompression
-        being a good example. Usually this is accomplished by using the 'Decorator' pattern
where
-        a wrapper entity class is used to decorate the original entity. Several protocol
-        interceptors can be combined to form one logical unit.
-        </para>
-        <para>
-        HTTP protocol processor is a collection of protocol interceptors that implements
the
-        'Chain of Responsibility' pattern, where each individual protocol interceptor is
expected
-        to work on the particular aspect of the HTTP protocol it is responsible for.
-        </para>
-        <para>
-        Usually the order in which interceptors are executed should not matter as long as
they do
-        not depend on a particular state of the execution context. If protocol interceptors
have
-        interdependencies and therefore must be executed in a particular order, they should
be
-        added to the protocol processor in the same sequence as their expected execution
order.
-        </para>
-        <para>
-        Protocol interceptors must be implemented as thread-safe. Similarly to servlets,
protocol
-        interceptors should not use instance variables unless access to those variables is
-        synchronized.
-        </para>
-        <section>
-            <title>Standard protocol interceptors</title>
-            <para>
-            HttpCore comes with a number of most essential protocol interceptors for client
and
-            server HTTP processing.
-            </para>
-            <section>
-                <title><classname>RequestContent</classname></title>
-                <para>
-                <classname>RequestContent</classname> is the most important interceptor
for
-                outgoing requests. It is responsible for delimiting content length by adding
-                the <literal>Content-Length</literal> or <literal>Transfer-Content</literal>
headers
-                based on the properties of the enclosed entity and the protocol version.
This
-                interceptor is required for correct functioning of client side protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>ResponseContent</classname></title>
-                <para>
-                <classname>ResponseContent</classname> is the most important
interceptor for
-                outgoing responses. It is responsible for delimiting content length by adding
-                <literal>Content-Length</literal> or <literal>Transfer-Content</literal>
headers
-                based on the properties of the enclosed entity and the protocol version.
This
-                interceptor is required for correct functioning of server side protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>RequestConnControl</classname></title>
-                <para>
-                <classname>RequestConnControl</classname> is responsible for
adding the
-                <literal>Connection</literal> header to the outgoing requests,
which is essential
-                for managing persistence of <literal>HTTP/1.0</literal> connections.
This
-                interceptor is recommended for client side protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>ResponseConnControl</classname></title>
-                <para>
-                <classname>ResponseConnControl</classname> is responsible for
adding
-                the <literal>Connection</literal> header to the outgoing responses,
which is essential
-                for managing persistence of <literal>HTTP/1.0</literal> connections.
This
-                interceptor is recommended for server side protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>RequestDate</classname></title>
-                <para>
-                <classname>RequestDate</classname> is responsible for adding
the
-                <literal>Date</literal> header to the outgoing requests. This
interceptor is
-                optional for client side protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>ResponseDate</classname></title>
-                <para>
-                <classname>ResponseDate</classname> is responsible for adding
the
-                <literal>Date</literal> header to the outgoing responses. This
interceptor is
-                recommended for server side protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>RequestExpectContinue</classname></title>
-                <para>
-                <classname>RequestExpectContinue</classname> is responsible for
enabling the
-                'expect-continue' handshake by adding the <literal>Expect</literal>
header. This
-                interceptor is recommended for client side protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>RequestTargetHost</classname></title>
-                <para>
-                <classname>RequestTargetHost</classname> is responsible for adding
the
-                <literal>Host</literal> header. This interceptor is required
for client side
-                protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>RequestUserAgent</classname></title>
-                <para>
-                <classname>RequestUserAgent</classname> is responsible for adding
the
-                <literal>User-Agent</literal> header. This interceptor is recommended
for client
-                side protocol processors.
-                </para>
-            </section>
-            <section>
-                <title><classname>ResponseServer</classname></title>
-                <para>
-                <classname>ResponseServer</classname> is responsible for adding
the
-                <literal>Server</literal> header. This interceptor is recommended
for server side
-                protocol processors.
-                </para>
-            </section>
-        </section>
-        <section>
-            <title>Working with protocol processors</title>
-            <para>
-            Usually HTTP protocol processors are used to pre-process incoming messages prior
to
-            executing application specific processing logic and to post-process outgoing
messages.
-            </para>
-            <programlisting><![CDATA[
-HttpProcessor httpproc = HttpProcessorBuilder.create()
-        // Required protocol interceptors
-        .add(new RequestContent())
-        .add(new RequestTargetHost())
-        // Recommended protocol interceptors
-        .add(new RequestConnControl())
-        .add(new RequestUserAgent("MyAgent-HTTP/1.1"))
-        // Optional protocol interceptors
-        .add(new RequestExpectContinue(true))
-        .build();
-
-HttpCoreContext context = HttpCoreContext.create();
-HttpRequest request = new BasicHttpRequest("GET", "/");
-httpproc.process(request, context);
-]]></programlisting>
-            <para>
-            Send the request to the target host and get a response.
-            </para>
-            <programlisting><![CDATA[
-HttpResponse = <...>
-httpproc.process(response, context);
-]]></programlisting>
-            <para>
-            Please note the <classname>BasicHttpProcessor</classname> class does
not synchronize
-            access to its internal structures and therefore may not be thread-safe.
-            </para>
-        </section>
-        <section>
-            <title>HTTP context</title>
-            <para>
-            Protocol interceptors can collaborate by sharing information - such as a processing
-            state - through an HTTP execution context. HTTP context is a structure that can
be
-            used to map an attribute name to an attribute value. Internally HTTP context
-            implementations are usually backed by a <classname>HashMap</classname>.
The primary
-            purpose of the HTTP context is to facilitate information sharing among various
-            logically related components. HTTP context can be used to store a processing
state for
-            one message or several consecutive messages. Multiple logically related messages
can
-            participate in a logical session if the same context is reused between consecutive
-            messages.
-            </para>
-            <programlisting><![CDATA[
-HttpProcessor httpproc = HttpProcessorBuilder.create()
-        .add(new HttpRequestInterceptor() {
-            public void process(
-                    HttpRequest request,
-                    HttpContext context) throws HttpException, IOException {
-                String id = (String) context.getAttribute("session-id");
-                if (id != null) {
-                    request.addHeader("Session-ID", id);
-                }
-            }
-        })
-        .build();
-
-HttpCoreContext context = HttpCoreContext.create();
-HttpRequest request = new BasicHttpRequest("GET", "/");
-httpproc.process(request, context);
-]]></programlisting>
-        </section>
-    </section>
-    <section>
         <title>Blocking HTTP protocol handlers</title>
         <section>
             <title>HTTP service</title>



Mime
View raw message