com.ibm.wbi.protocol.http.beans
Class CgiGenerator
com.ibm.wbi.Meg
|
+--com.ibm.wbi.Generator
|
+--com.ibm.wbi.protocol.http.HttpGenerator
|
+--com.ibm.wbi.protocol.http.beans.CgiGenerator
- public class CgiGenerator
- extends HttpGenerator
This class wraps a CGI executable by launching a new process
and setting the CGI/1.1 environment variables. It starts the
specified executable, routing standard input and standard output
as appropriate.
|
Field Summary |
protected java.lang.String |
executable
name of the CGI executable |
protected java.lang.String |
translatedPath
the translated path that is sent to the CGI in the PATH_TRANSLATED
environment variable |
|
Constructor Summary |
CgiGenerator()
Construct a new CGI Generator |
CgiGenerator(java.lang.String executable)
Construct a new CGI Generator and specify the name of the
CGI executable. |
CgiGenerator(java.lang.String executable,
java.lang.String translatedPath)
Construct a new CGI Generator and specify the name of the
CGI executable and translated path property. |
|
Method Summary |
java.lang.String |
getExecutable()
get the executable that will be run when the CGI is accessed. |
java.lang.String |
getTranslatedPath()
get the translated path. |
void |
handleRequest(RequestEvent e)
handle the request by starting up a process with the appropriate
environment variables, launching the CGI executable, and routing
standard input and standard output as appropriate. |
void |
setExecutable(java.lang.String executable)
set the executable that will be run when the CGI is accessed. |
void |
setTranslatedPath(java.lang.String translatedPath)
set the translated path that will be passed to the CGI executable through the
PATH_TRANSLATED environment variable. |
| Methods inherited from class com.ibm.wbi.protocol.http.HttpGenerator |
add, addCookie, getContentType, getHttpResponse, getHttpResponseString, getResponseCode, getResponseText, isCache, produceHeader, set, setCache, setContentLength, setContentType, setResponseCode, setResponseText, setServer, writeHeader |
| Methods inherited from class com.ibm.wbi.Meg |
forwardRequest, getCondition, getEnabled, getMegProperty, getMegProperty, getMegPropertyKeys, getName, getPlugin, getPriority, getSystemContext, initialize, initialize, isEnabled, isMegApplicable, loadMegResources, run, setCondition, setEnabled, setMegProperty, setName, setPriority, setSystemContext, setup, setup, setup, setup |
executable
protected java.lang.String executable
- name of the CGI executable
translatedPath
protected java.lang.String translatedPath
- the translated path that is sent to the CGI in the PATH_TRANSLATED
environment variable
CgiGenerator
public CgiGenerator()
- Construct a new CGI Generator
CgiGenerator
public CgiGenerator(java.lang.String executable)
- Construct a new CGI Generator and specify the name of the
CGI executable. The translated path property is set to "".
CgiGenerator
public CgiGenerator(java.lang.String executable,
java.lang.String translatedPath)
- Construct a new CGI Generator and specify the name of the
CGI executable and translated path property.
setExecutable
public void setExecutable(java.lang.String executable)
- set the executable that will be run when the CGI is accessed. This
should be an absolute path to the executable.
- Parameters:
executable - the executable to be run
getExecutable
public java.lang.String getExecutable()
- get the executable that will be run when the CGI is accessed.
- Returns:
- the executable to be run
setTranslatedPath
public void setTranslatedPath(java.lang.String translatedPath)
- set the translated path that will be passed to the CGI executable through the
PATH_TRANSLATED environment variable. This normally refers to a local filename,
which could refer to the executable or may be the input for an interpreter.
- Parameters:
translatedPath - the translated path
getTranslatedPath
public java.lang.String getTranslatedPath()
- get the translated path.
- Returns:
- the translated path
handleRequest
public void handleRequest(RequestEvent e)
throws RequestRejectedException,
java.io.IOException
- handle the request by starting up a process with the appropriate
environment variables, launching the CGI executable, and routing
standard input and standard output as appropriate.
- Overrides:
handleRequest in class HttpGenerator
- Following copied from class:
com.ibm.wbi.protocol.http.HttpGenerator
- Parameters:
e - The RequestEvent.- Throws:
RequestRejectedException - If rejecting request, this
must be thrown before the first write() is
made to the output stream.java.io.Exception - can be thrown if an exception was generated
by the Meg while processing the MegInput/OutputStreams.