au.com.lastweekend.cgi
Interface CGI

All Known Implementing Classes:
CGIProcess, FastCGI

public interface CGI

Expected lifecycle

  • exec(scriptFile,env)
  • pipeInput(inFromRequest)
  • getStandardOutput()
  • terminate()
  • getExitCode()
  • Version:
    $Id: CGI.java 100 2008-02-19 10:37:27Z lwoggardner $
    Author:
    ggardner

    Method Summary
     void exec(java.io.File script, java.util.Map<java.lang.String,java.lang.String> env)
              Execute the CGI script
     int getExitCode()
               
     java.io.InputStream getStandardOutput()
               
     void pipeInput(java.io.InputStream requestIn, int contentLength)
              Send request input to the CGI process
     void terminate()
              Causes any CGI related system resources to be returned.
     

    Method Detail

    exec

    void exec(java.io.File script,
              java.util.Map<java.lang.String,java.lang.String> env)
              throws CGIException
    Execute the CGI script

    Parameters:
    script - The script.
    env - CGI arguments
    Throws:
    CGIException

    pipeInput

    void pipeInput(java.io.InputStream requestIn,
                   int contentLength)
                   throws java.io.IOException
    Send request input to the CGI process

    Parameters:
    requestIn -
    contentLength - in bytes
    Throws:
    java.io.IOException

    getStandardOutput

    java.io.InputStream getStandardOutput()
                                          throws java.io.IOException
    Returns:
    The standard output of the CGI process as an input stream.
    Throws:
    java.io.IOException

    terminate

    void terminate()
    Causes any CGI related system resources to be returned.


    getExitCode

    int getExitCode()
                    throws java.lang.IllegalThreadStateException
    Returns:
    the exit code from the CGI script
    Throws:
    java.lang.IllegalStateException - if the script has not been terminated yet.
    java.lang.IllegalThreadStateException


    Copyright © 2008. All Rights Reserved.