Refactor package structure
Introduce http and dispatch packages under org.springframework.web to separate HTTP-specific adapter code from higher level web framework code. Move classes into their respective locations.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.reactive.web;
|
||||
package org.springframework.reactive.web.dispatch;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.HashMap;
|
||||
@@ -25,7 +25,9 @@ import org.reactivestreams.Publisher;
|
||||
import reactor.rx.Streams;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.reactive.web.rxnetty.RequestHandlerAdapter;
|
||||
import org.springframework.reactive.web.http.ServerHttpRequest;
|
||||
import org.springframework.reactive.web.http.ServerHttpResponse;
|
||||
import org.springframework.reactive.web.http.rxnetty.RequestHandlerAdapter;
|
||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||
|
||||
/**
|
||||
@@ -44,7 +46,7 @@ public class DispatcherApp {
|
||||
SimpleUrlHandlerMapping handlerMapping = wac.getBean(SimpleUrlHandlerMapping.class);
|
||||
handlerMapping.addHandler("/text", new HelloWorldTextHandler());
|
||||
|
||||
DispatcherHttpHandler dispatcherHandler = new DispatcherHttpHandler();
|
||||
DispatcherHandler dispatcherHandler = new DispatcherHandler();
|
||||
dispatcherHandler.initStrategies(wac);
|
||||
|
||||
RequestHandlerAdapter requestHandler = new RequestHandlerAdapter(dispatcherHandler);
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.reactive.web;
|
||||
package org.springframework.reactive.web.http;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Random;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.reactive.web;
|
||||
package org.springframework.reactive.web.http;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -25,9 +25,9 @@ import org.reactivestreams.Subscription;
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class CountingHttpHandler implements HttpHandler {
|
||||
public class CountingHandler implements ServerHttpHandler {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(CountingHttpHandler.class);
|
||||
private static final Log logger = LogFactory.getLog(CountingHandler.class);
|
||||
|
||||
@Override
|
||||
public Publisher<Void> handle(ServerHttpRequest request, ServerHttpResponse response) {
|
||||
@@ -14,14 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.reactive.web;
|
||||
package org.springframework.reactive.web.http;
|
||||
|
||||
import org.reactivestreams.Publisher;
|
||||
|
||||
import org.springframework.reactive.web.http.ServerHttpHandler;
|
||||
import org.springframework.reactive.web.http.ServerHttpRequest;
|
||||
import org.springframework.reactive.web.http.ServerHttpResponse;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class EchoHandler implements HttpHandler {
|
||||
public class EchoHandler implements ServerHttpHandler {
|
||||
|
||||
@Override
|
||||
public Publisher<Void> handle(ServerHttpRequest request, ServerHttpResponse response) {
|
||||
@@ -13,15 +13,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.reactive.web.rxnetty;
|
||||
package org.springframework.reactive.web.http.rxnetty;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.reactivex.netty.protocol.http.server.HttpServer;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import org.springframework.reactive.web.EchoHandler;
|
||||
import org.springframework.reactive.web.AbstractHttpHandlerIntegrationTestCase;
|
||||
import org.springframework.reactive.web.http.EchoHandler;
|
||||
import org.springframework.reactive.web.http.AbstractHttpHandlerIntegrationTestCase;
|
||||
|
||||
/**
|
||||
* @author Rossen Stoyanchev
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.reactive.web.servlet;
|
||||
package org.springframework.reactive.web.http.servlet;
|
||||
|
||||
import javax.servlet.AsyncContext;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.reactive.web.servlet;
|
||||
package org.springframework.reactive.web.http.servlet;
|
||||
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
@@ -23,8 +23,8 @@ import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import org.springframework.reactive.web.AbstractHttpHandlerIntegrationTestCase;
|
||||
import org.springframework.reactive.web.EchoHandler;
|
||||
import org.springframework.reactive.web.http.AbstractHttpHandlerIntegrationTestCase;
|
||||
import org.springframework.reactive.web.http.EchoHandler;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.reactive.web.servlet;
|
||||
package org.springframework.reactive.web.http.servlet;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -24,8 +24,8 @@ import org.apache.catalina.startup.Tomcat;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import org.springframework.reactive.web.AbstractHttpHandlerIntegrationTestCase;
|
||||
import org.springframework.reactive.web.EchoHandler;
|
||||
import org.springframework.reactive.web.http.AbstractHttpHandlerIntegrationTestCase;
|
||||
import org.springframework.reactive.web.http.EchoHandler;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
Reference in New Issue
Block a user