comparison 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
comparison
equal deleted inserted replaced
100:933bbc9fc11f 101:7fc0650f194c
13 import de.intevation.artifacts.ArtifactDatabase; 13 import de.intevation.artifacts.ArtifactDatabase;
14 14
15 import org.apache.log4j.Logger; 15 import org.apache.log4j.Logger;
16 16
17 import org.restlet.Component; 17 import org.restlet.Component;
18 import org.restlet.Server;
18 19
19 import org.restlet.data.Protocol; 20 import org.restlet.data.Protocol;
20 21
21 /** 22 /**
22 * Starts an HTTP server bound to a RestApp. 23 * Starts an HTTP server bound to a RestApp.
79 80
80 RestApp app = new RestApp(db); 81 RestApp app = new RestApp(db);
81 82
82 Component component = new Component(); 83 Component component = new Component();
83 84
85 Server server = null;
86
84 if (listenString != null) { 87 if (listenString != null) {
85 component.getServers().add(Protocol.HTTP, listenString, port); 88 server = new Server(Protocol.HTTP, listenString, port);
86 } 89 }
87 else { 90 else {
88 component.getServers().add(Protocol.HTTP, port); 91 server = new Server(Protocol.HTTP, port);
89 } 92 }
93
94 component.getServers().add(server);
95
96 server.getContext().getParameters().add("maxThreads", "512");
90 97
91 component.getDefaultHost().attach(app); 98 component.getDefaultHost().attach(app);
92 99
93 logger.info("Starting rest HTTP server on " 100 logger.info("Starting rest HTTP server on "
94 + (listenString != null ? listenString : "*") 101 + (listenString != null ? listenString : "*")

http://dive4elements.wald.intevation.org