alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Jetty example source code file (Generator.java)

This example Jetty source code file (Generator.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Jetty tags/keywords

generator, io, ioexception, ioexception, last=true, last=true, more=false, more=false, string, string

The Jetty Generator.java source code

//========================================================================
//Copyright 2006 Mort Bay Consulting Pty. Ltd.
//------------------------------------------------------------------------
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at 
//http://www.apache.org/licenses/LICENSE-2.0
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//========================================================================


package org.mortbay.jetty;

import java.io.IOException;

import org.mortbay.io.Buffer;

public interface Generator
{
    public static final boolean LAST=true;
    public static final boolean MORE=false;

    /* ------------------------------------------------------------ */
    /**
     * Add content.
     * 
     * @param content
     * @param last
     * @throws IllegalArgumentException if <code>content is {@link Buffer#isImmutable immutable}.
     * @throws IllegalStateException If the request is not expecting any more content,
     *   or if the buffers are full and cannot be flushed.
     * @throws IOException if there is a problem flushing the buffers.
     */
    void addContent(Buffer content, boolean last) throws IOException;

    /* ------------------------------------------------------------ */
    /**
     * Add content.
     * 
     * @param b byte
     * @return true if the buffers are full
     * @throws IOException
     */
    boolean addContent(byte b) throws IOException;

    void complete() throws IOException;

    void completeHeader(HttpFields responseFields, boolean last) throws IOException;

    long flush() throws IOException;

    int getContentBufferSize();

    long getContentWritten();
    
    boolean isContentWritten();

    void increaseContentBufferSize(int size);
    
    boolean isBufferFull();

    boolean isCommitted();

    boolean isComplete();

    boolean isPersistent();

    void reset(boolean returnBuffers);

    void resetBuffer();

    void sendError(int code, String reason, String content, boolean close) throws IOException;
    
    void setHead(boolean head);

    void setRequest(String method, String uri);

    void setResponse(int status, String reason);


    void setSendServerVersion(boolean sendServerVersion);
 
    void setVersion(int version);

    boolean isIdle();

    void setContentLength(long length);
    
    void setPersistent(boolean persistent);
    

}

Other Jetty examples (source code examples)

Here is a short list of links related to this Jetty Generator.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.