Package org.eclipse.jetty.server

Examples of org.eclipse.jetty.server.HttpConnection$ContentCallback


            ? (Request)req : HttpConnection.getCurrentConnection().getRequest();
           
        if (!"HEAD".equals(req.getMethod())) {
            //bug in Jetty with persistent connections that if a HEAD is
            //sent, a _head flag is never reset
            HttpConnection c = baseRequest.getConnection();
            if (c != null) {
                c.getGenerator().setHead(false);
            }
        }
        if (getServer().isSetRedirectURL()) {
            resp.sendRedirect(getServer().getRedirectURL());
            resp.flushBuffer();
View Full Code Here


            ? (Request)req : HttpConnection.getCurrentConnection().getRequest();
           
        if (!"HEAD".equals(req.getMethod())) {
            //bug in Jetty with persistent connections that if a HEAD is
            //sent, a _head flag is never reset
            HttpConnection c = baseRequest.getConnection();
            if (c != null) {
                c.getGenerator().setHead(false);
            }
        }
        if (getServer().isSetRedirectURL()) {
            resp.sendRedirect(getServer().getRedirectURL());
            resp.flushBuffer();
View Full Code Here

            ? (Request)req : HttpConnection.getCurrentConnection().getRequest();
           
        if (!"HEAD".equals(req.getMethod())) {
            //bug in Jetty with persistent connections that if a HEAD is
            //sent, a _head flag is never reset
            HttpConnection c = baseRequest.getConnection();
            if (c != null) {
                c.getGenerator().setHead(false);
            }
        }
        if (getServer().isSetRedirectURL()) {
            resp.sendRedirect(getServer().getRedirectURL());
            resp.flushBuffer();
View Full Code Here

            ? (Request)req : HttpConnection.getCurrentConnection().getRequest();
           
        if (!"HEAD".equals(req.getMethod())) {
            //bug in Jetty with persistent connections that if a HEAD is
            //sent, a _head flag is never reset
            HttpConnection c = baseRequest.getConnection();
            if (c != null) {
                c.getGenerator().setHead(false);
            }
        }
        if (getServer().isSetRedirectURL()) {
            resp.sendRedirect(getServer().getRedirectURL());
            resp.flushBuffer();
View Full Code Here

        }
    }

    protected void onConnectSuccess(ConnectContext connectContext, UpstreamConnection upstreamConnection)
    {
        HttpConnection httpConnection = connectContext.getHttpConnection();
        ByteBuffer requestBuffer = httpConnection.getRequestBuffer();
        ByteBuffer buffer = BufferUtil.EMPTY_BUFFER;
        int remaining = requestBuffer.remaining();
        if (remaining > 0)
        {
            buffer = bufferPool.acquire(remaining, requestBuffer.isDirect());
            BufferUtil.flipToFill(buffer);
            buffer.put(requestBuffer);
            buffer.flip();
        }

        ConcurrentMap<String, Object> context = connectContext.getContext();
        HttpServletRequest request = connectContext.getRequest();
        prepareContext(request, context);

        EndPoint downstreamEndPoint = httpConnection.getEndPoint();
        DownstreamConnection downstreamConnection = newDownstreamConnection(downstreamEndPoint, context, buffer);
        downstreamConnection.setInputBufferSize(getBufferSize());

        upstreamConnection.setConnection(downstreamConnection);
        downstreamConnection.setConnection(upstreamConnection);
View Full Code Here

                sockresp.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Endpoint Creation Failed");
                return false;
            }

            // Get the original HTTPConnection
            HttpConnection connection = (HttpConnection)request.getAttribute("org.eclipse.jetty.server.HttpConnection");
           
            // Send the upgrade
            EventDriver driver = eventDriverFactory.wrap(websocketPojo);
            return upgrade(connection, sockreq, sockresp, driver);
        }
View Full Code Here

        HttpConnectionFactory httpFactory = new HttpConnectionFactory()
        {
            @Override
            public Connection newConnection(Connector connector, EndPoint endPoint)
            {
                return configure(new HttpConnection(getHttpConfiguration(), connector, endPoint, true)
                {
                    @Override
                    protected HttpParser newHttpParser()
                    {
                        return new HttpParser(newRequestHandler(), getHttpConfiguration().getRequestHeaderSize())
View Full Code Here

{
    /* ------------------------------------------------------------ */
    @Override
    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
    {
        HttpConnection connection = HttpConnection.getCurrentConnection();
        connection.getRequest().setHandled(true);
        String method = request.getMethod();
    
        if(!method.equals(HttpMethods.GET) && !method.equals(HttpMethods.POST) && !method.equals(HttpMethods.HEAD))
            return;
       
        response.setContentType(MimeTypes.TEXT_PLAIN_UTF_8) ;
        response.setHeader(HttpHeaders.CACHE_CONTROL, "must-revalidate,no-cache,no-store") ;
       
        ByteArrayOutputStream bytes = new ByteArrayOutputStream(1024) ;
        //String writer = IO.UTF8(null) ;
        Writer writer = new OutputStreamWriter(bytes, "UTF-8") ;
       
        handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason());
       
        if ( ! Fuseki.VERSION.equalsIgnoreCase("development") )
        {
            writer.write("\n") ;
            writer.write("\n") ;
View Full Code Here

                sockresp.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "Endpoint Creation Failed");
                return false;
            }

            // Get the original HTTPConnection
            HttpConnection connection = (HttpConnection)request.getAttribute("org.eclipse.jetty.server.HttpConnection");
           
            // Send the upgrade
            EventDriver driver = eventDriverFactory.wrap(websocketPojo);
            return upgrade(connection, sockreq, sockresp, driver);
        }
View Full Code Here

   */
  /**
   * Allows subclass to override Conection if required.
   */
  protected Connection newConnection(EndPoint endpoint) {
    return new HttpConnection(this, endpoint, getServer());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.server.HttpConnection$ContentCallback

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.