Skip to content

Commit

Permalink
Minor improvements and clean-up.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Aug 28, 2016
1 parent f9ba446 commit c498043
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
Expand Up @@ -45,6 +45,7 @@ public FastHttpProtocol(HttpProcessor processor) {
this.processor = processor; this.processor = processor;
} }


@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void process(Channel channel) { public void process(Channel channel) {
if (channel.isInitial()) { if (channel.isInitial()) {
Expand Down
Expand Up @@ -50,12 +50,10 @@ public abstract class AbstractAsyncHttpHandler extends AbstractHttpHandler {


private final FastHttp http; private final FastHttp http;


private final HttpRoutes routes; @SuppressWarnings("UnusedParameters")

public AbstractAsyncHttpHandler(FastHttp http, HttpRoutes routes, RouteOptions options) { public AbstractAsyncHttpHandler(FastHttp http, HttpRoutes routes, RouteOptions options) {
super(options); super(options);
this.http = http; this.http = http;
this.routes = routes;
} }


@Override @Override
Expand Down
Expand Up @@ -22,7 +22,6 @@


import org.rapidoid.annotation.Authors; import org.rapidoid.annotation.Authors;
import org.rapidoid.annotation.Since; import org.rapidoid.annotation.Since;
import org.rapidoid.http.FastHttp;
import org.rapidoid.http.HttpStatus; import org.rapidoid.http.HttpStatus;
import org.rapidoid.http.MediaType; import org.rapidoid.http.MediaType;
import org.rapidoid.http.Req; import org.rapidoid.http.Req;
Expand All @@ -37,14 +36,12 @@
@Since("5.2.0") @Since("5.2.0")
public class NonBlockingHttpHandler extends AbstractHttpHandler { public class NonBlockingHttpHandler extends AbstractHttpHandler {


private final FastHttp http; private final Callable<?> nonBlockingLogic;
private final Callable<Object> nonBlockingLogic;
private final boolean returnsJson; private final boolean returnsJson;


public NonBlockingHttpHandler(FastHttp http, RouteOptions options, Callable<Object> nonBlockingLogic) { public NonBlockingHttpHandler(RouteOptions options, Callable<?> nonBlockingLogic) {
super(options); super(options);


this.http = http;
this.nonBlockingLogic = nonBlockingLogic; this.nonBlockingLogic = nonBlockingLogic;
this.returnsJson = options.contentType() == MediaType.JSON; this.returnsJson = options.contentType() == MediaType.JSON;
} }
Expand Down
Expand Up @@ -439,7 +439,7 @@ private void addOrRemove(boolean add, String verbs, String path, HttpHandler han
String tx = txm != TransactionMode.NONE ? AnsiColor.bold(txm.name()) : txm.name(); String tx = txm != TransactionMode.NONE ? AnsiColor.bold(txm.name()) : txm.name();


Log.info("Registering handler", "!setup", this.customization.name(), "!verbs", verbs, "!path", path, Log.info("Registering handler", "!setup", this.customization.name(), "!verbs", verbs, "!path", path,
"!roles", opts.roles(), "tx", tx, "handler", handler); "!roles", opts.roles(), "tx", tx, "mvc", opts.mvc());
} else { } else {
Log.info("Deregistering handler", "setup", this.customization.name(), "!verbs", verbs, "!path", path); Log.info("Deregistering handler", "setup", this.customization.name(), "!verbs", verbs, "!path", path);
} }
Expand Down
Expand Up @@ -35,9 +35,9 @@
@Since("4.3.0") @Since("4.3.0")
public class CallableHttpHandler extends AbstractAsyncHttpHandler { public class CallableHttpHandler extends AbstractAsyncHttpHandler {


private final Callable<Object> handler; private final Callable<?> handler;


public CallableHttpHandler(FastHttp http, HttpRoutes routes, RouteOptions options, Callable<Object> handler) { public CallableHttpHandler(FastHttp http, HttpRoutes routes, RouteOptions options, Callable<?> handler) {
super(http, routes, options); super(http, routes, options);
this.handler = handler; this.handler = handler;
} }
Expand Down
Expand Up @@ -60,6 +60,8 @@ public interface ProtocolContext<T> {


void setRequest(IRequest request); void setRequest(IRequest request);


boolean onSameThread();

/* PROTOCOL */ /* PROTOCOL */


boolean isInitial(); boolean isInitial();
Expand Down

0 comments on commit c498043

Please sign in to comment.