Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.http.nio.protocol
Interface HttpRequestExecutionHandler

Deprecated. (4.2) use `HttpAsyncRequestExecutor` and `HttpAsyncRequester`

    @Deprecated
    public interface HttpRequestExecutionHandler

HTTP request execution handler can be used by client-side protocol handlers to trigger the submission of a new HTTP request and the processing of an HTTP response.

Since:
  4.0

Method Summary
`void` | `finalizeContext(HttpContext context)` Deprecated. Triggered when the connection is terminated.
`void` | `handleResponse(HttpResponse response, HttpContext context)` Deprecated. Triggered when an HTTP response is ready to be processed.
`void` | `initalizeContext(HttpContext context, Object attachment)` Deprecated. Triggered when a new connection has been established and the HTTP context needs to be initialized.
`HttpRequest` | `submitRequest(HttpContext context)` Deprecated. Triggered when the underlying connection is ready to send a new HTTP request to the target host.

Method Detail

### initalizeContext

    void initalizeContext(HttpContext context,
                          Object attachment)

  Deprecated.
  Triggered when a new connection has been established and the HTTP context needs to be initialized.

  The attachment object is the same object which was passed to the connecting I/O reactor when the connection request was made. The attachment may optionally contain some state information required in order to correctly initialize the HTTP context.

  Parameters:
    `context` - the actual HTTP context
    `attachment` - the object passed to the connecting I/O reactor upon the request for a new connection.
  See Also:
    `ConnectingIOReactor.connect(java.net.SocketAddress, java.net.SocketAddress, java.lang.Object, org.apache.http.nio.reactor.SessionRequestCallback)`

### submitRequest

    HttpRequest submitRequest(HttpContext context)

  Deprecated.
  Triggered when the underlying connection is ready to send a new HTTP request to the target host. This method may return `null` if the client is not yet ready to send a request. In this case the connection will remain open and can be activated at a later point.

  Parameters:
    `context` - the actual HTTP context
  Returns:
    an HTTP request to be sent or `null` if no request needs to be sent

### handleResponse

    void handleResponse(HttpResponse response,
                        HttpContext context)
                        throws IOException

  Deprecated.
  Triggered when an HTTP response is ready to be processed.

  Parameters:
    `response` - the HTTP response to be processed
    `context` - the actual HTTP context
  Throws:
    `IOException` - if a problem is encountered

### finalizeContext

    void finalizeContext(HttpContext context)

  Deprecated.
  Triggered when the connection is terminated. This event can be used to release objects stored in the context or perform some other kind of cleanup.

  Parameters:
    `context` - the actual HTTP context

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.