All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.rack.RackResponseEnvironment Maven / Gradle / Ivy

Go to download

A servlet bridge for (Ruby-based) Rack applications that allow them to run in Java Application servers using JRuby.

There is a newer version: 1.2.2
Show newest version
/*
 * Copyright (c) 2010-2012 Engine Yard, Inc.
 * Copyright (c) 2007-2009 Sun Microsystems, Inc.
 * This source code is available under the MIT license.
 * See the file LICENSE.txt for details.
 */

package org.jruby.rack;

import java.io.IOException;

/**
 * Rack response environment interface that is likely to be only implemented 
 * as a servlet response.
 * 
 * @see javax.servlet.ServletResponse
 * @see RackResponse
 * 
 * @author nicksieger
 */
public interface RackResponseEnvironment {
    
    /**
     * @see RackResponse#respond(RackResponseEnvironment)
     * @param response
     * @throws IOException 
     */
    void defaultRespond(RackResponse response) throws IOException;

    /**
     * @return whether the underlying (servlet) response has been committed.
     */
    boolean isCommitted();

    /**
     * Reset the response buffer so we can begin a new response.
     */
    void reset();

    /**
     * Tell the server to send a simple error page response (based on the 
     * status code).
     * @param code the (HTTP) status code
     * @throws IOException 
     */
    void sendError(int code) throws IOException;
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy