Browse Source

Updates to Javadoc

pull/1111/head
Rossen Stoyanchev 10 years ago
parent
commit
1dcaff8a5c
  1. 4
      spring-web-reactive/src/main/java/org/springframework/http/server/reactive/FilterChainHttpHandler.java
  2. 18
      spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpFilter.java
  3. 9
      spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpFilterChain.java
  4. 20
      spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpHandler.java

4
spring-web-reactive/src/main/java/org/springframework/http/server/reactive/FilterChainHttpHandler.java

@ -24,8 +24,8 @@ import org.reactivestreams.Publisher; @@ -24,8 +24,8 @@ import org.reactivestreams.Publisher;
import org.springframework.util.Assert;
/**
* An {@link HttpHandler} decorator that delegates to a list of
* {@link HttpFilter}s and the target {@link HttpHandler}.
* {@link HttpHandler} that delegates to a chain of {@link HttpFilter}s followed
* by a target {@link HttpHandler}.
*
* @author Rossen Stoyanchev
*/

18
spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpFilter.java

@ -19,11 +19,27 @@ package org.springframework.http.server.reactive; @@ -19,11 +19,27 @@ package org.springframework.http.server.reactive;
import org.reactivestreams.Publisher;
/**
* Contract for interception-style, chained processing of HTTP requests.
*
* <p>Filters may be used to implement cross-cutting, application-agnostic
* requirements such as security, timeouts, and others.
*
* <p>{@link FilterChainHttpHandler} provides a way of constructing a chain of
* {@link HttpFilter}s followed by a target {@link HttpHandler}.
*
* @author Rossen Stoyanchev
* @see FilterChainHttpHandler
*/
public interface HttpFilter {
/**
* Process the given request and optionally delegate to the next HttpFilter.
*
* @param request current HTTP request.
* @param response current HTTP response.
* @param chain provides a way to delegate to the next HttpFilter.
* @return Publisher to indicate when request processing is complete.
*/
Publisher<Void> filter(ServerHttpRequest request, ServerHttpResponse response,
HttpFilterChain chain);

9
spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpFilterChain.java

@ -19,10 +19,19 @@ import org.reactivestreams.Publisher; @@ -19,10 +19,19 @@ import org.reactivestreams.Publisher;
/**
* Represents a chain of {@link HttpFilter}s allowing each {@link HttpFilter} to
* delegate to the next in the chain.
*
* @author Rossen Stoyanchev
*/
public interface HttpFilterChain {
/**
*
* @param request current HTTP request.
* @param response current HTTP response.
* @return Publisher to indicate when request handling is complete.
*/
Publisher<Void> filter(ServerHttpRequest request, ServerHttpResponse response);
}

20
spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpHandler.java

@ -19,29 +19,21 @@ package org.springframework.http.server.reactive; @@ -19,29 +19,21 @@ package org.springframework.http.server.reactive;
import org.reactivestreams.Publisher;
/**
* Interface for handlers that process HTTP requests and generate an HTTP response.
* This handler is designed to be called when the HTTP headers have been received, making
* the HTTP request body available as stream. The HTTP response body can also be written
* as a stream.
* Contract for handling HTTP requests in a non-blocking way.
*
* @author Arjen Poutsma
* @author Rossen Stoyanchev
* @author Sebastien Deleuze
* @see ServerHttpRequest#getBody()
* @see ServerHttpResponse#setBody(Publisher)
* @see HttpFilter
*/
public interface HttpHandler {
/**
* Process the given request, generating a response in an asynchronous non blocking way.
* Implementations should not throw exceptions but signal them via the returned
* {@code Publisher<Void>}.
* Handle the given request and generate a response.
*
* @param request current HTTP request, the body can be processed as a data stream.
* @param response current HTTP response, the body can be provided as a data stream.
* @return A {@code Publisher<Void>} used to signal the demand, and receive a notification
* when the handling is complete (success or error) including the flush of the data on the
* network.
* @param request current HTTP request.
* @param response current HTTP response.
* @return Publisher to indicate when request handling is complete.
*/
Publisher<Void> handle(ServerHttpRequest request, ServerHttpResponse response);

Loading…
Cancel
Save