terp - the Codemesh Modular
Template Interpreter v1.3.309

com.codemesh.terp.util
Class PumpStreamHandler

java.lang.Object
  extended by com.codemesh.terp.util.PumpStreamHandler

public class PumpStreamHandler
extends java.lang.Object


Constructor Summary
PumpStreamHandler(java.lang.Process p)
          Construct a new pump stream handler which uses byte array buffers to hold the output.
PumpStreamHandler(java.lang.Process p, java.io.OutputStream out, java.io.OutputStream err)
          Construct a new pump stream handler.
PumpStreamHandler(java.lang.Process p, java.io.OutputStream out, java.io.OutputStream err, java.io.InputStream in)
          Construct a new pump stream handler.
 
Method Summary
protected  java.lang.Thread createPump(java.io.InputStream is, java.io.OutputStream os)
          Creates a stream pumper.
 java.io.OutputStream getErr()
          Get the error stream.
 java.io.OutputStream getOut()
          Get the output stream.
 void setProcessInputStream(java.io.OutputStream os)
          Set the output stream which is sending input to the process.
 void start()
          Start the threads.
 void stop()
          Stop pumping the streams.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PumpStreamHandler

public PumpStreamHandler(java.lang.Process p)
Construct a new pump stream handler which uses byte array buffers to hold the output.

Parameters:
p - the process to hook up.

PumpStreamHandler

public PumpStreamHandler(java.lang.Process p,
                         java.io.OutputStream out,
                         java.io.OutputStream err)
Construct a new pump stream handler.

Parameters:
p - the process to hook up.
out - the output stream.
err - the error stream.

PumpStreamHandler

public PumpStreamHandler(java.lang.Process p,
                         java.io.OutputStream out,
                         java.io.OutputStream err,
                         java.io.InputStream in)
Construct a new pump stream handler.

Parameters:
p - the process to hook up.
out - the output stream.
err - the error stream.
in - the input stream.
Method Detail

setProcessInputStream

public void setProcessInputStream(java.io.OutputStream os)
Set the output stream which is sending input to the process.

Parameters:
os - the OutputStream.

start

public void start()
Start the threads.


stop

public void stop()
Stop pumping the streams.


getOut

public java.io.OutputStream getOut()
Get the output stream.

Returns:
the output stream.

getErr

public java.io.OutputStream getErr()
Get the error stream.

Returns:
the error stream.

createPump

protected java.lang.Thread createPump(java.io.InputStream is,
                                      java.io.OutputStream os)
Creates a stream pumper.

Parameters:
is - the input stream.
os - the output stream.
Returns:
the thread on which the pumping is being performed.

terp - the Codemesh Modular
Template Interpreter v1.3.309

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.