Mercurial > dive4elements > framework
diff artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java @ 101:7fc0650f194c
Upgraded the Restlet version to 2.0.4 (current stable).
artifacts/trunk@1281 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 01 Feb 2011 16:15:03 +0000 |
parents | 933bbc9fc11f |
children | b2115f484edb |
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java Tue Nov 02 17:23:36 2010 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/Standalone.java Tue Feb 01 16:15:03 2011 +0000 @@ -15,6 +15,7 @@ import org.apache.log4j.Logger; import org.restlet.Component; +import org.restlet.Server; import org.restlet.data.Protocol; @@ -81,13 +82,19 @@ Component component = new Component(); + Server server = null; + if (listenString != null) { - component.getServers().add(Protocol.HTTP, listenString, port); + server = new Server(Protocol.HTTP, listenString, port); } else { - component.getServers().add(Protocol.HTTP, port); + server = new Server(Protocol.HTTP, port); } + component.getServers().add(server); + + server.getContext().getParameters().add("maxThreads", "512"); + component.getDefaultHost().attach(app); logger.info("Starting rest HTTP server on "