Package org.eclipse.jetty.http.gzip

Examples of org.eclipse.jetty.http.gzip.CompressedResponseWrapper


                        _handler.handle(target,baseRequest, request, response);
                        return;
                    }
                }

                final CompressedResponseWrapper wrappedResponse = newGzipResponseWrapper(request,response);
               
                boolean exceptional=true;
                try
                {
                    _handler.handle(target, baseRequest, request, wrappedResponse);
                    exceptional=false;
                }
                finally
                {
                    Continuation continuation = ContinuationSupport.getContinuation(request);
                    if (continuation.isSuspended() && continuation.isResponseWrapped())  
                    {
                        continuation.addContinuationListener(new ContinuationListener()
                        {
                            public void onComplete(Continuation continuation)
                            {
                                try
                                {
                                    wrappedResponse.finish();
                                }
                                catch(IOException e)
                                {
                                    LOG.warn(e);
                                }
                            }

                            public void onTimeout(Continuation continuation)
                            {}
                        });
                    }
                    else if (exceptional && !response.isCommitted())
                    {
                        wrappedResponse.resetBuffer();
                        wrappedResponse.noCompression();
                    }
                    else
                        wrappedResponse.finish();
                }
            }
            else
            {
                _handler.handle(target,baseRequest, request, response);
View Full Code Here


     * @param response the response
     * @return the gzip response wrapper
     */
    protected CompressedResponseWrapper newGzipResponseWrapper(HttpServletRequest request, HttpServletResponse response)
    {
        return new CompressedResponseWrapper(request,response)
        {
            {
                super.setMimeTypes(GzipHandler.this._mimeTypes);
                super.setBufferSize(GzipHandler.this._bufferSize);
                super.setMinCompressSize(GzipHandler.this._minGzipSize);
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.http.gzip.CompressedResponseWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.