org.apache.tools.ant.taskdefs.optional.perforce
Class P4HandlerAdapter
java.lang.Object
org.apache.tools.ant.taskdefs.optional.perforce.P4HandlerAdapter
- ExecuteStreamHandler, P4Handler
public abstract class P4HandlerAdapter
extends java.lang.Object
base class to manage streams around the execution of the Perforce
command line client
abstract void | process(String line) - subclasses of P4HandlerAdapter must implement this routine
processing of one line of stdout or of stderr
|
void | setOutput(String p4Input) - set any data to be written to P4's stdin
|
void | setProcessErrorStream(InputStream is) - connects the handler to the stderr of the Perforce process
|
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
|
void | setProcessOutputStream(InputStream is) - connects the handler to the stdout of the Perforce process
|
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.
|
void | stop() - stops the processing of streams
called from P4Base#execP4Command(String command, P4Handler handler)
|
process
public abstract void process(String line)
subclasses of P4HandlerAdapter must implement this routine
processing of one line of stdout or of stderr
- process in interface P4Handler
line
- line of stdout or stderr to process
setOutput
public void setOutput(String p4Input)
set any data to be written to P4's stdin
- setOutput in interface P4Handler
p4Input
- the text to write to P4's stdin
setProcessErrorStream
public void setProcessErrorStream(InputStream is)
throws IOException
connects the handler to the stderr of the Perforce process
- setProcessErrorStream in interface ExecuteStreamHandler
is
- stderr coming from Perforce
setProcessInputStream
public void setProcessInputStream(OutputStream os)
throws IOException
connects the handler to the input stream into Perforce
used indirectly by tasks requiring to send specific standard input
such as p4label, p4change
- setProcessInputStream in interface ExecuteStreamHandler
os
- the stream bringing input to the p4 executable
setProcessOutputStream
public void setProcessOutputStream(InputStream is)
throws IOException
connects the handler to the stdout of the Perforce process
- setProcessOutputStream in interface ExecuteStreamHandler
is
- stdout coming from Perforce
start
public void start()
throws BuildException
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.
- start in interface ExecuteStreamHandler
stop
public void stop()
stops the processing of streams
called from P4Base#execP4Command(String command, P4Handler handler)
- stop in interface ExecuteStreamHandler
Copyright B) 2000-2006 Apache Software Foundation. All Rights Reserved.