Separate out web.server from http.server.reactive

This change separates out lower-level HTTP adapter code from the more
(framework-specific) HTTP processing into a separate package under
org.springframework.web.server (not under org.springframework.http).
This commit is contained in:
Rossen Stoyanchev 2016-01-07 21:44:40 -05:00
parent 94be412327
commit 54e4e012b2
13 changed files with 51 additions and 20 deletions

View File

@ -22,9 +22,6 @@ import reactor.Mono;
* Contract for handling HTTP requests in a non-blocking way. * Contract for handling HTTP requests in a non-blocking way.
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @author Rossen Stoyanchev
* @author Sebastien Deleuze
* @see HttpFilter
*/ */
public interface HttpHandler { public interface HttpHandler {

View File

@ -17,7 +17,7 @@ package org.springframework.web.reactive;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.server.reactive.HttpExceptionHandler; import org.springframework.web.server.HttpExceptionHandler;
import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.ResponseStatusException; import org.springframework.web.ResponseStatusException;

View File

@ -13,13 +13,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
@ -21,6 +21,10 @@ import java.util.List;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
/** /**
* {@link HttpHandler} that delegates to a chain of {@link HttpFilter}s followed * {@link HttpHandler} that delegates to a chain of {@link HttpFilter}s followed
* by a target {@link HttpHandler}. * by a target {@link HttpHandler}.

View File

@ -13,10 +13,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
/** /**
* A contract for resolving exceptions from HTTP request handling. * A contract for resolving exceptions from HTTP request handling.
* *

View File

@ -14,11 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import org.reactivestreams.Publisher;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
/** /**
* Contract for interception-style, chained processing of HTTP requests. * Contract for interception-style, chained processing of HTTP requests.
* *

View File

@ -13,10 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
/** /**
* Represents a chain of {@link HttpFilter}s allowing each {@link HttpFilter} to * Represents a chain of {@link HttpFilter}s allowing each {@link HttpFilter} to
* delegate to the next in the chain. * delegate to the next in the chain.

View File

@ -13,10 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**

View File

@ -13,11 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
/** /**
* Handle any exception by setting the response status to 500. * Handle any exception by setting the response status to 500.

View File

@ -37,11 +37,11 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.ResponseStatusException; import org.springframework.web.ResponseStatusException;
import org.springframework.http.server.reactive.ErrorHandlingHttpHandler; import org.springframework.web.server.ErrorHandlingHttpHandler;
import org.springframework.http.server.reactive.FilterChainHttpHandler; import org.springframework.web.server.FilterChainHttpHandler;
import org.springframework.http.server.reactive.HttpExceptionHandler; import org.springframework.web.server.HttpExceptionHandler;
import org.springframework.http.server.reactive.HttpFilter; import org.springframework.web.server.HttpFilter;
import org.springframework.http.server.reactive.HttpFilterChain; import org.springframework.web.server.HttpFilterChain;
import org.springframework.http.server.reactive.HttpHandler; import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.MockServerHttpRequest; import org.springframework.http.server.reactive.MockServerHttpRequest;
import org.springframework.http.server.reactive.MockServerHttpResponse; import org.springframework.http.server.reactive.MockServerHttpResponse;

View File

@ -31,7 +31,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.RequestEntity; import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.http.server.reactive.AbstractHttpHandlerIntegrationTests; import org.springframework.http.server.reactive.AbstractHttpHandlerIntegrationTests;
import org.springframework.http.server.reactive.ErrorHandlingHttpHandler; import org.springframework.web.server.ErrorHandlingHttpHandler;
import org.springframework.http.server.reactive.HttpHandler; import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.http.server.reactive.ServerHttpResponse;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import java.net.URI; import java.net.URI;
@ -27,6 +27,14 @@ import reactor.rx.stream.Signal;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.MockServerHttpRequest;
import org.springframework.http.server.reactive.MockServerHttpResponse;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.server.ErrorHandlingHttpHandler;
import org.springframework.web.server.HttpExceptionHandler;
import org.springframework.web.server.InternalServerErrorExceptionHandler;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.http.server.reactive; package org.springframework.web.server;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -22,6 +22,10 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import reactor.Mono; import reactor.Mono;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.http.server.reactive.ServerHttpResponse;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;