Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.dropwizard.jetty;
 
 
 import javax.servlet.*;
A org.eclipse.jetty.servlet.ServletHolder subclass which removes the synchronization around servlet initialization by requiring a pre-initialized servlet holder.
public class NonblockingServletHolder extends ServletHolder {
    private final Servlet servlet;
    public NonblockingServletHolder(Servlet servlet) {
        super(servlet);
        this. = servlet;
    }
    @Override
    public boolean equals(Object o) {
        return (o instanceof NonblockingServletHolder) && (this.compareTo(o) == 0);
    }
    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = (31 * result) + (( != null) ? .hashCode() : 0);
        return result;
    }
    @Override
    public Servlet getServlet() throws ServletException {
        return ;
    }
    @Override
    public void handle(Request baseRequest,
                       ServletRequest request,
                       ServletResponse responsethrows ServletExceptionIOException {
        final boolean asyncSupported = baseRequest.isAsyncSupported();
        if (!isAsyncSupported()) {
            baseRequest.setAsyncSupported(false);
        }
        try {
            .service(requestresponse);
        } finally {
            baseRequest.setAsyncSupported(asyncSupported);
        }
    }
New to GrepCode? Check out our FAQ X