From 628c6e1a9566bc6ad2ac911e77cbf47e833bd968 Mon Sep 17 00:00:00 2001 From: Greg Orzell Date: Tue, 12 Aug 2014 16:01:06 -0700 Subject: [PATCH] Add a generic Handler interface and change the RequestHandler to be a child interface of the generic one. --- .../main/java/io/reactivex/netty/channel/Handler.java | 10 ++++++++++ .../netty/protocol/http/server/RequestHandler.java | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 rx-netty/src/main/java/io/reactivex/netty/channel/Handler.java diff --git a/rx-netty/src/main/java/io/reactivex/netty/channel/Handler.java b/rx-netty/src/main/java/io/reactivex/netty/channel/Handler.java new file mode 100644 index 00000000..afb82292 --- /dev/null +++ b/rx-netty/src/main/java/io/reactivex/netty/channel/Handler.java @@ -0,0 +1,10 @@ +package io.reactivex.netty.channel; + + +import rx.Observable; + +public interface Handler { + + Observable handle(IN input, OUT output); + +} diff --git a/rx-netty/src/main/java/io/reactivex/netty/protocol/http/server/RequestHandler.java b/rx-netty/src/main/java/io/reactivex/netty/protocol/http/server/RequestHandler.java index a67f0593..5e588102 100644 --- a/rx-netty/src/main/java/io/reactivex/netty/protocol/http/server/RequestHandler.java +++ b/rx-netty/src/main/java/io/reactivex/netty/protocol/http/server/RequestHandler.java @@ -15,12 +15,13 @@ */ package io.reactivex.netty.protocol.http.server; +import io.reactivex.netty.channel.Handler; import rx.Observable; /** * @author Nitesh Kant */ -public interface RequestHandler { +public interface RequestHandler extends Handler, HttpServerResponse> { Observable handle(HttpServerRequest request, HttpServerResponse response);