com.atlassian.fisheye.plugins.scm.utils.process
Class CopyOutputHandler

java.lang.Object
  extended by com.atlassian.fisheye.plugins.scm.utils.process.CopyOutputHandler
All Implemented Interfaces:
OutputHandler

public class CopyOutputHandler
extends java.lang.Object
implements OutputHandler

An Output Handler which copies the process output into a give output stream


Constructor Summary
CopyOutputHandler(java.io.OutputStream dest)
          Create a CopyOutputHandler to redirect output from the process to the given stream
 
Method Summary
 void complete()
          Called when the process completes.
 void process(java.io.InputStream output)
          Process an output stream generated by the external process (either stdout or stderr)
 void setWatchdog(Watchdog watchdog)
          Set the watchdog that this handler should be resetting to prevent the process from being terminated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyOutputHandler

public CopyOutputHandler(java.io.OutputStream dest)
Create a CopyOutputHandler to redirect output from the process to the given stream

Parameters:
dest - the stream to which output is to be written
Method Detail

process

public void process(java.io.InputStream output)
             throws ProcessException
Description copied from interface: OutputHandler
Process an output stream generated by the external process (either stdout or stderr)

Specified by:
process in interface OutputHandler
Parameters:
output - the external process' output stream (available as an input to this class)
Throws:
ProcessException - if there is a problem processing the output

setWatchdog

public void setWatchdog(Watchdog watchdog)
Description copied from interface: OutputHandler
Set the watchdog that this handler should be resetting to prevent the process from being terminated. The watchdog should be called periodically based on output generated by the process.

Specified by:
setWatchdog in interface OutputHandler
Parameters:
watchdog - process watchdog instance.

complete

public void complete()
Description copied from interface: OutputHandler
Called when the process completes. This call allows the output handler to close any open resources and finalize any processing.

Specified by:
complete in interface OutputHandler