Package org.mortbay.jetty

Examples of org.mortbay.jetty.HttpConnection$Output


    for (Iterator i = list.iterator(); i.hasNext();) {
      source.setBookmark(bookmark);

      ElementOutputList.ElementOutput elementOutput = (ElementOutputList.ElementOutput)i.next();
      Element element = elementOutput.getElement();
      Output output = elementOutput.getOutput();
     
      boolean elementNot = elementOutput.isNot();

      if (this.caseSensitive != null) {
        caseSensitive = this.caseSensitive.booleanValue();
      }
      if (elementOutput.isCaseSensitive() != null) {
        caseSensitive = elementOutput.isCaseSensitive().booleanValue();
      }

      boolean match = false;
      if (output.receive()) {
        if (receive) {
          match = recorder.playMatch(element, source.getBookmark());
          source.setBookmark(recorder.playBookmark());
        } else {
          output.init(source);
          int mindex = recorder.reserveMatchIndex(level, element, source.getBookmark(), parentNot, elementNot);
          int bindex = recorder.reserveBookmarkIndex();
          match = element.parse(level, source, not|parentNot|elementNot, caseSensitive, false);
          match = match != elementNot;
          recorder.set(level, source, element, bookmark, source.getBookmark(), source.getBestIndex(), mindex, bindex, match, parentNot, elementNot);
          output.set(source, bookmark);
        }
      } else {
        if (receive) {
          match = recorder.playMatch(element, source.getBookmark());
        } else {
          int index = recorder.reserveMatchIndex(level, element, source.getBookmark(), parentNot, elementNot);
          match = element.parse(level, source, not|parentNot|elementNot, caseSensitive, false);
          match = (match != elementNot);
          recorder.set(level, source, element, bookmark, source.getBookmark(), source.getBestIndex(), index, match, parentNot, elementNot);
        }
      }

      if (match) {
        if (receive && !elementNot && !not) {
          source.setBookmark(bookmark);
          output.init(source);
          element.parse(level, source, not|parentNot|elementNot, caseSensitive, receive);
          output.set(source, bookmark);
        }
                output = list.getOutput();
                if (output != null && receive) {
                    output.init(source);
                    output.set(source, bookmark);
                }
               
                return !not;
      }
    }
    if (not) {
      source.setBookmark(bookmark);
      source.skipCharacter();

      Output output = list.getOutput();
      if (output != null && receive) {
        output.init(source);
        output.set(source, bookmark);
      }
    } else {
      recorder.setIndex(recIndex);
    }
View Full Code Here


    int startIndex = recorder.getIndex();
   
    for (Iterator i = list.iterator(); i.hasNext();) {
      ElementOutput elementOutput = (ElementOutput)i.next();
      Element element = elementOutput.getElement();
      Output output = elementOutput.getOutput();
      boolean elementNot = elementOutput.isNot();

      if (this.caseSensitive != null) {
        caseSensitive = this.caseSensitive.booleanValue();
      }
      if (elementOutput.isCaseSensitive() != null) {
        caseSensitive = elementOutput.isCaseSensitive().booleanValue();
      }

      int bookmark = source.getBookmark();

      boolean match = false;
      if (output.receive()) {
        if (receive) {
          match = recorder.playMatch(element, source.getBookmark());
          source.setBookmark(recorder.playBookmark());
        } else {
          output.init(source);
          int mindex = recorder.reserveMatchIndex(level, element, source.getBookmark(), parentNot, elementNot);
          int bindex = recorder.reserveBookmarkIndex();
          match = element.parse(level, source, not|parentNot|elementNot, caseSensitive, false);
          match = match != elementNot;
          recorder.set(level, source, element, bookmark, source.getBookmark(), source.getBestIndex(), mindex, bindex, match, parentNot, elementNot);
          output.set(source, bookmark);
        }
      } else {
        if (receive) {
          match = recorder.playMatch(element, source.getBookmark());
        } else {
          int mindex = recorder.reserveMatchIndex(level, element, source.getBookmark(), parentNot, elementNot);
          match = element.parse(level, source, not|parentNot|elementNot, caseSensitive, false);
          match = match != elementNot;
          recorder.set(level, source, element, bookmark, source.getBookmark(), source.getBestIndex(), mindex, match, parentNot, elementNot);
        }
      }
     
      if (match == not) {
        if (!receive) {
          recorder.setIndex(startIndex);
        }
        return false;
      }
     
      if (not) {
        break;
      }

      if (elementNot) {
        source.setBookmark(bookmark);
        source.skipCharacter();
        if (source.getBookmark() > bestMatchIdx) {
          source.setBestIndex(source.getBookmark());
        }
      }

      if (receive) {
        if (elementNot) {
          output.init(source);
          output.set(source, bookmark);
        } else {
          source.setBookmark(bookmark);
          output.init(source);
          element.parse(level, source, not|parentNot|elementNot, caseSensitive, receive);
          output.set(source, bookmark);
        }
      }
    }

    if (not) {
View Full Code Here

    }

    /* ------------------------------------------------------------------------------- */
    protected Connection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint)
    {
        HttpConnection connection=(HttpConnection)super.newConnection(channel,endpoint);
        ((HttpParser)connection.getParser()).setForceContentBuffer(true);
        return connection;
    }
View Full Code Here

    }

    /* ------------------------------------------------------------------------------- */
    protected Connection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint)
    {
        HttpConnection connection=(HttpConnection)super.newConnection(channel,endpoint);
        ((HttpParser)connection.getParser()).setForceContentBuffer(true);
        return connection;
    }
View Full Code Here

            super(request,response,contentLength,bufferSize,minGzipSize);
        }

        protected boolean setContentEncodingGzip()
        {
            HttpConnection connection = HttpConnection.getCurrentConnection();
            connection.getResponseFields().put("Content-Encoding", "gzip");
            return true;
        }
View Full Code Here

    public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException
    {
        HttpConnection.getCurrentConnection().getRequest().setHandled(true);
        response.setContentType(MimeTypes.TEXT_HTML_8859_1);
        ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(4096);
        HttpConnection connection = HttpConnection.getCurrentConnection();
        handleErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason());
        writer.flush();
        response.setContentLength(writer.size());
        writer.writeTo(response.getOutputStream());
        writer.destroy();
    }
View Full Code Here

    }

    /* ------------------------------------------------------------------------------- */
    protected Connection newConnection(SocketChannel channel,SelectChannelEndPoint endpoint)
    {
        return new HttpConnection(SelectChannelConnector.this,endpoint,getServer());
    }
View Full Code Here

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

        }

        // Handle data constraint
        if (dataConstraint > Constraint.DC_NONE)
        {
            HttpConnection connection = HttpConnection.getCurrentConnection();
            Connector connector = connection.getConnector();
           
            switch (dataConstraint)
            {
                case Constraint.DC_INTEGRAL :
                    if (connector.isIntegral(request))
View Full Code Here

    }

    /* ------------------------------------------------------------------------------- */
    protected Connection newConnection(SocketChannel channel,SelectChannelEndPoint endpoint)
    {
        return new HttpConnection(SelectChannelConnector.this,endpoint,getServer());
    }
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.HttpConnection$Output

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.