Skip to content

Commit

Permalink
Abstraction of the HTTP routes and access through the HTTP request ob…
Browse files Browse the repository at this point in the history
…ject.
  • Loading branch information
nmihajlovski committed Apr 18, 2016
1 parent 42ccf89 commit 664b84a
Show file tree
Hide file tree
Showing 11 changed files with 571 additions and 481 deletions.
1 change: 1 addition & 0 deletions rapidoid-commons/src/main/resources/rapidoid-classes.txt
Expand Up @@ -314,6 +314,7 @@ org.rapidoid.http.HttpMetadata
org.rapidoid.http.HttpParser
org.rapidoid.http.HttpResponseCodes
org.rapidoid.http.HttpRoutes
org.rapidoid.http.HttpRoutesImpl
org.rapidoid.http.HttpStatus
org.rapidoid.http.HttpUtils
org.rapidoid.http.HttpVerb
Expand Down
12 changes: 6 additions & 6 deletions rapidoid-http-fast/src/main/java/org/rapidoid/http/FastHttp.java
Expand Up @@ -51,20 +51,20 @@ public class FastHttp extends AbstractHttpProcessor {

private static final HttpParser HTTP_PARSER = new HttpParser();

private final HttpRoutes routes;
private final HttpRoutesImpl routes;
private final Customization customization;

private final Map<String, Object> attributes = Coll.synchronizedMap();
private final Map<String, Map<String, Serializable>> sessions = Coll.mapOfMaps();

public FastHttp(HttpRoutes routes, Customization customization) {
public FastHttp(HttpRoutesImpl routes) {
super(null);
this.routes = routes;
this.customization = customization;
this.customization = routes.custom();
}

public FastHttp(Customization customization) {
this(new HttpRoutes(customization), customization);
this(new HttpRoutesImpl(customization));
}

public synchronized void on(String verb, String path, HttpHandler handler) {
Expand Down Expand Up @@ -158,7 +158,7 @@ public void onRequest(Channel channel, boolean isGet, boolean isKeepAlive, Range
cookies = Collections.synchronizedMap(cookies);

req = new ReqImpl(this, channel, isKeepAlive, verb, uri, path, query, body, params, headers, cookies,
posted, files, contentType, segment, customization);
posted, files, contentType, segment, routes);

if (!attributes.isEmpty()) {
req.attrs().putAll(attributes);
Expand Down Expand Up @@ -268,7 +268,7 @@ public Customization custom() {
return customization;
}

public HttpRoutes getRoutes() {
public HttpRoutesImpl getRoutes() {
return routes;
}

Expand Down

0 comments on commit 664b84a

Please sign in to comment.