Browse Source

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).
pull/1111/head
Rossen Stoyanchev 10 years ago
parent
commit
54e4e012b2
  1. 3
      spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpHandler.java
  2. 2
      spring-web-reactive/src/main/java/org/springframework/web/reactive/ResponseStatusExceptionHandler.java
  3. 5
      spring-web-reactive/src/main/java/org/springframework/web/server/ErrorHandlingHttpHandler.java
  4. 6
      spring-web-reactive/src/main/java/org/springframework/web/server/FilterChainHttpHandler.java
  5. 6
      spring-web-reactive/src/main/java/org/springframework/web/server/HttpExceptionHandler.java
  6. 7
      spring-web-reactive/src/main/java/org/springframework/web/server/HttpFilter.java
  7. 5
      spring-web-reactive/src/main/java/org/springframework/web/server/HttpFilterChain.java
  8. 5
      spring-web-reactive/src/main/java/org/springframework/web/server/HttpHandlerDecorator.java
  9. 4
      spring-web-reactive/src/main/java/org/springframework/web/server/InternalServerErrorExceptionHandler.java
  10. 10
      spring-web-reactive/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java
  11. 2
      spring-web-reactive/src/test/java/org/springframework/web/reactive/handler/SimpleUrlHandlerMappingIntegrationTests.java
  12. 10
      spring-web-reactive/src/test/java/org/springframework/web/server/ErrorHandlingHttpHandlerTests.java
  13. 6
      spring-web-reactive/src/test/java/org/springframework/web/server/FilterChainHttpHandlerTests.java

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

@ -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 {

2
spring-web-reactive/src/main/java/org/springframework/web/reactive/ResponseStatusExceptionHandler.java

@ -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;

5
spring-web-reactive/src/main/java/org/springframework/http/server/reactive/ErrorHandlingHttpHandler.java → spring-web-reactive/src/main/java/org/springframework/web/server/ErrorHandlingHttpHandler.java

@ -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;
/** /**

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

@ -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}.

6
spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpExceptionHandler.java → spring-web-reactive/src/main/java/org/springframework/web/server/HttpExceptionHandler.java

@ -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.
* *

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

@ -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.
* *

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

@ -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.

5
spring-web-reactive/src/main/java/org/springframework/http/server/reactive/HttpHandlerDecorator.java → spring-web-reactive/src/main/java/org/springframework/web/server/HttpHandlerDecorator.java

@ -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;
/** /**

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

@ -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.

10
spring-web-reactive/src/test/java/org/springframework/web/reactive/DispatcherHandlerErrorTests.java

@ -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;

2
spring-web-reactive/src/test/java/org/springframework/web/reactive/handler/SimpleUrlHandlerMappingIntegrationTests.java

@ -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;

10
spring-web-reactive/src/test/java/org/springframework/http/server/reactive/ErrorHandlingHttpHandlerTests.java → spring-web-reactive/src/test/java/org/springframework/web/server/ErrorHandlingHttpHandlerTests.java

@ -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;

6
spring-web-reactive/src/test/java/org/springframework/http/server/reactive/FilterChainHttpHandlerTests.java → spring-web-reactive/src/test/java/org/springframework/web/server/FilterChainHttpHandlerTests.java

@ -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;
Loading…
Cancel
Save