| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.catalina.ant.BaseRedirectorHelperTask
public abstract class BaseRedirectorHelperTask
Abstract base class to add output redirection support for Catalina
 Ant tasks. These tasks require Ant 1.5 or later.
 
 WARNING: due to depends chain, Ant could call a Task 
 more than once and this can affect the output redirection when configured.
 If you are collecting the output in a property, it will collect the output
 of only the first run, since Ant properties are immutable and once created
 they cannot be changed.
 
 If you are collecting output in a file the file will be overwritten with the
 output of the last run, unless you set append="true", in which case each run 
 will append it's output to the file.
| Field Summary | |
|---|---|
| protected  boolean | alwaysLogFlag which indicates that, if redirected, output should also be always sent to the log. | 
| protected  boolean | failOnErrorWhether to fail (with a BuildException) if ManagerServlet returns an error. | 
| protected  java.io.OutputStream | redirectErrStreamThe stream for error output | 
| protected  org.apache.tools.ant.taskdefs.Redirector | redirectorRedirector helper | 
| protected  boolean | redirectorConfiguredwill be set to truewhen the configuration of the Redirector is
 complete. | 
| protected  org.apache.tools.ant.types.RedirectorElement | redirectorElementRedirector element for this task | 
| protected  boolean | redirectOutputtruetrue when output redirection is requested for this task . | 
| protected  java.io.OutputStream | redirectOutStreamThe stream for info output | 
| Fields inherited from class org.apache.tools.ant.Task | 
|---|
| target, taskName, taskType, wrapper | 
| Fields inherited from class org.apache.tools.ant.ProjectComponent | 
|---|
| description, location, project | 
| Constructor Summary | |
|---|---|
| BaseRedirectorHelperTask() | |
| Method Summary | |
|---|---|
|  void | addConfiguredRedirector(org.apache.tools.ant.types.RedirectorElement redirectorElement)Add a RedirectorElementto this task. | 
| protected  void | closeRedirector()Ask redirector to close all the streams. | 
| protected  void | handleErrorFlush(java.lang.String output)Handles error output with the ERR priority and flushes the stream. | 
| protected  void | handleErrorOutput(java.lang.String output)Handles error output with the ERR priority. | 
| protected  void | handleFlush(java.lang.String output)Handles output with the INFO priority and flushes the stream. | 
| protected  void | handleFlush(java.lang.String output,
            int priority)Handles output with ERR priority to error stream and all other pritorities to output stream, then flushes the stream. | 
| protected  void | handleOutput(java.lang.String output)Handles output with the INFO priority. | 
| protected  void | handleOutput(java.lang.String output,
             int priority)Handles output with ERR priority to error stream and all other pritorities to output stream. | 
|  boolean | isFailOnError()Returns the value of the failOnError property. | 
| protected  void | openRedirector()Set up properties on the Redirector and create output streams. | 
|  void | setAlwaysLog(boolean alwaysLog)If true, (error and non-error) output will be redirected as specified while being sent to Ant's logging mechanism as if no redirection had taken place. | 
|  void | setAppend(boolean append)If true, append output to existing file. | 
|  void | setCreateEmptyFiles(boolean createEmptyFiles)Whether output and error files should be created even when empty. | 
|  void | setError(java.io.File error)File the error output of the task is redirected to. | 
|  void | setErrorProperty(java.lang.String errorProperty)Property name whose value should be set to the error of the task.. | 
|  void | setFailonerror(boolean fail)Whether to fail (with a BuildException) if ManagerServlet returns an error. | 
|  void | setLogError(boolean logError)Controls whether error output is logged. | 
|  void | setOutput(java.io.File out)File the output of the task is redirected to. | 
|  void | setOutputproperty(java.lang.String outputProperty)Property name whose value should be set to the output of the task. | 
| Methods inherited from class org.apache.tools.ant.Task | 
|---|
| bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleInput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType | 
| Methods inherited from class org.apache.tools.ant.ProjectComponent | 
|---|
| clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected org.apache.tools.ant.taskdefs.Redirector redirector
protected org.apache.tools.ant.types.RedirectorElement redirectorElement
protected java.io.OutputStream redirectOutStream
protected java.io.OutputStream redirectErrStream
protected boolean failOnError
protected boolean redirectOutput
true true when output redirection is requested for this task .
 Default is to log on Ant log.
protected boolean redirectorConfigured
true when the configuration of the Redirector is
 complete.
protected boolean alwaysLog
| Constructor Detail | 
|---|
public BaseRedirectorHelperTask()
| Method Detail | 
|---|
public void setFailonerror(boolean fail)
public boolean isFailOnError()
public void setOutput(java.io.File out)
out - name of the output filepublic void setError(java.io.File error)
error - name of the error filepublic void setLogError(boolean logError)
logError - if true the standard error is sent to the Ant log system
        and not sent to output stream.public void setOutputproperty(java.lang.String outputProperty)
outputProperty - property namepublic void setErrorProperty(java.lang.String errorProperty)
errorProperty - property namepublic void setAppend(boolean append)
append - if true, append output to existing filepublic void setAlwaysLog(boolean alwaysLog)
Redirector itself.
alwaysLog - booleanpublic void setCreateEmptyFiles(boolean createEmptyFiles)
createEmptyFiles - boolean.public void addConfiguredRedirector(org.apache.tools.ant.types.RedirectorElement redirectorElement)
RedirectorElement to this task.
redirectorElement - RedirectorElement.protected void openRedirector()
protected void closeRedirector()
protected void handleOutput(java.lang.String output)
handleOutput in class org.apache.tools.ant.Taskoutput - The output to log. Should not be null.protected void handleFlush(java.lang.String output)
handleFlush in class org.apache.tools.ant.Taskoutput - The output to log. Should not be null.protected void handleErrorOutput(java.lang.String output)
handleErrorOutput in class org.apache.tools.ant.Taskoutput - The error output to log. Should not be null.protected void handleErrorFlush(java.lang.String output)
handleErrorFlush in class org.apache.tools.ant.Taskoutput - The error output to log. Should not be null.
protected void handleOutput(java.lang.String output,
                            int priority)
output - The output to log. Should not be null.
protected void handleFlush(java.lang.String output,
                           int priority)
output - The output to log. Should not be null.| 
 | Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||