Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use the non-blocking servlet.

  • Loading branch information...
commit 3b5614fcc702bd8688ea890e0ee0098852ce067d 1 parent 169094e
@codahale codahale authored
View
5 dropwizard-core/src/main/java/com/yammer/dropwizard/config/ServerFactory.java
@@ -6,6 +6,7 @@
import com.sun.jersey.spi.container.servlet.ServletContainer;
import com.yammer.dropwizard.jersey.JacksonMessageBodyProvider;
import com.yammer.dropwizard.jetty.BiDiGzipHandler;
+import com.yammer.dropwizard.jetty.NonblockingServletHolder;
import com.yammer.dropwizard.jetty.UnbrandedErrorHandler;
import com.yammer.dropwizard.servlets.ThreadNameFilter;
import com.yammer.dropwizard.util.Duration;
@@ -301,7 +302,7 @@ private Handler createHandler(Environment env) {
private Handler createInternalServlet(Environment env) {
final ServletContextHandler handler = env.getAdminContext();
- handler.addServlet(new ServletHolder(new AdminServlet()), "/*");
+ handler.addServlet(new NonblockingServletHolder(new AdminServlet()), "/*");
if (config.getAdminPort() != 0 && config.getAdminPort() == config.getPort()) {
handler.setContextPath("/admin");
@@ -352,7 +353,7 @@ private Handler createExternalServlet(Environment env) {
new JacksonMessageBodyProvider(env.getJsonEnvironment().build(),
env.getValidator())
);
- final ServletHolder jerseyHolder = new ServletHolder(jerseyContainer);
+ final ServletHolder jerseyHolder = new NonblockingServletHolder(jerseyContainer);
jerseyHolder.setInitOrder(Integer.MAX_VALUE);
handler.addServlet(jerseyHolder, env.getJerseyEnvironment().getUrlPattern());
}
Please sign in to comment.
Something went wrong with that request. Please try again.