org.apache.tools.ant.taskdefs.optional.perforce

Class P4HandlerAdapter

public abstract class P4HandlerAdapter extends Object implements P4Handler

base class to manage streams around the execution of the Perforce command line client
Method Summary
abstract voidprocess(String line)
subclasses of P4HandlerAdapter must implement this routine processing of one line of stdout or of stderr
voidsetOutput(String p4Input)
set any data to be written to P4's stdin
voidsetProcessErrorStream(InputStream is)
connects the handler to the stderr of the Perforce process
voidsetProcessInputStream(OutputStream os)
connects the handler to the input stream into Perforce used indirectly by tasks requiring to send specific standard input such as p4label, p4change
voidsetProcessOutputStream(InputStream is)
connects the handler to the stdout of the Perforce process
voidstart()
this routine gets called by the execute routine of the Execute class it connects the PumpStreamHandler to the input/output/error streams of the process.
voidstop()
stops the processing of streams called from P4Base#execP4Command(String command, P4Handler handler)

Method Detail

process

public abstract void process(String line)
subclasses of P4HandlerAdapter must implement this routine processing of one line of stdout or of stderr

Parameters: line line of stdout or stderr to process

setOutput

public void setOutput(String p4Input)
set any data to be written to P4's stdin

Parameters: p4Input the text to write to P4's stdin

setProcessErrorStream

public void setProcessErrorStream(InputStream is)
connects the handler to the stderr of the Perforce process

Parameters: is stderr coming from Perforce

Throws: IOException under unknown circumstances

setProcessInputStream

public void setProcessInputStream(OutputStream os)
connects the handler to the input stream into Perforce used indirectly by tasks requiring to send specific standard input such as p4label, p4change

Parameters: os the stream bringing input to the p4 executable

Throws: IOException under unknown circumstances

setProcessOutputStream

public void setProcessOutputStream(InputStream is)
connects the handler to the stdout of the Perforce process

Parameters: is stdout coming from Perforce

Throws: IOException under unknown circumstances

start

public void start()
this routine gets called by the execute routine of the Execute class it connects the PumpStreamHandler to the input/output/error streams of the process.

Throws: BuildException if there is a error.

See Also: Execute

stop

public void stop()
stops the processing of streams called from P4Base#execP4Command(String command, P4Handler handler)

See Also: P4Base