Top Description Inners Constructors Methods
org.codehaus.groovy.runtime

public Class ProcessGroovyMethods

extends DefaultGroovyMethodsSupport
Class Inheritance
Imports
groovy.lang.Closure, .GroovyRuntimeException, java.io.BufferedInputStream, .BufferedOutputStream, .BufferedReader, .File, .IOException, .InputStream, .InputStreamReader, .OutputStream, .Writer, java.util.List

This class defines new groovy methods which appear on normal JDK classes related to process management.

Static methods are used with the first parameter being the destination class, i.e. public static String reverse(String self) provides a reverse() method for String.

Note

While this class contains many 'public' static methods, it is primarily regarded as an internal class (its internal package name suggests this also). We value backwards compatibility of these methods when used within Groovy but value less backwards compatibility at the Java method call level. I.e. future versions of Groovy may remove or move a method call in this file but would normally aim to keep the method available from within Groovy.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
protected static class
ProcessGroovyMethods.ProcessRunner

A Runnable which waits for a process to complete together with a notification scheme allowing another thread to wait a maximum number of seconds for the process to complete before killing it.

private static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
closeStreams(Process
a Process
self
)

Closes all the streams associated with the process (ignoring any IOExceptions).

public static Thread

Returns:

the Thread
consumeProcessErrorStream
(Process
a Process
self
,
OutputStream
an OutputStream to capture the process stderr
err
)

Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer.

public static Thread

Returns:

the Thread
consumeProcessErrorStream
(Process
a Process
self
,
Appendable
an Appendable to capture the process stderr
error
)

Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer.

public static void
consumeProcessOutput(Process
a Process
self
)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.

public static void
consumeProcessOutput(Process
a Process
self
,
Appendable
an Appendable to capture the process stdout
output
,
Appendable
an Appendable to capture the process stderr
error
)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.

public static void
consumeProcessOutput(Process
a Process
self
,
OutputStream
an OutputStream to capture the process stdout
output
,
OutputStream
an OutputStream to capture the process stderr
error
)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.

public static Thread

Returns:

the Thread
consumeProcessOutputStream
(Process
a Process
self
,
Appendable
an Appendable to capture the process stdout
output
)

Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer.

public static Thread

Returns:

the Thread
consumeProcessOutputStream
(Process
a Process
self
,
OutputStream
an OutputStream to capture the process stdout
output
)

Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer.

public static Process

Returns:

the Process which has just started for this command line representation
execute
(final String
a command line String
self
)

Executes the command specified by self as a command-line process.

public static Process

Returns:

the Process which has just started for this command line representation.
execute
(final String
a command line String to be executed.
self
,
final String[]
an array of Strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.
envp
,
final File
the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
dir
)

Executes the command specified by self with environment defined by envp and under the working directory dir.

public static Process

Returns:

the Process which has just started for this command line representation.
execute
(final String
a command line String to be executed.
self
,
final List<E>
a List of Objects (converted to Strings using toString), each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.
envp
,
final File
the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
dir
)

Executes the command specified by self with environment defined by envp and under the working directory dir.

public static Process

Returns:

the Process which has just started for this command line representation.
execute
(final String[]
an array of String containing the command name and parameters as separate items in the array.
commandArray
)

Executes the command specified by the given String array.

public static Process

Returns:

the Process which has just started for this command line representation.
execute
(final String[]
an array of String containing the command name and parameters as separate items in the array.
commandArray
,
final String[]
an array of Strings, each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.
envp
,
final File
the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
dir
)

Executes the command specified by the String array given in the first parameter, with the environment defined by envp and under the working directory dir.

public static Process

Returns:

the Process which has just started for this command line representation.
execute
(final String[]
an array of String containing the command name and parameters as separate items in the array.
commandArray
,
final List<E>
a List of Objects (converted to Strings using toString), each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.
envp
,
final File
the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
dir
)

Executes the command specified by the String array given in the first parameter, with the environment defined by envp and under the working directory dir.

public static Process

Returns:

the Process which has just started for this command line representation.
execute
(final List<E>
a list containing the command name and parameters as separate items in the list.
commands
)

Executes the command specified by the given list.

public static Process

Returns:

the Process which has just started for this command line representation.
execute
(final List<E>
a List containing the command name and parameters as separate items in the list.
commands
,
final String[]
an array of Strings, each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.
envp
,
final File
the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
dir
)

Executes the command specified by the given list, with the environment defined by envp and under the working directory dir.

public static Process

Returns:

the Process which has just started for this command line representation.
execute
(final List<E>
a List containing the command name and parameters as separate items in the list.
commands
,
final List<E>
a List of Objects (converted to Strings using toString), each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.
envp
,
final File
the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.
dir
)

Executes the command specified by the given list, with the environment defined by envp and under the working directory dir.

public static InputStream

Returns:

the error InputStream for the process
getErr
(Process
a Process instance
self
)

An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.

public static InputStream

Returns:

the InputStream for the process
getIn
(Process
a Process instance
self
)

An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.

public static OutputStream

Returns:

the OutputStream for the process
getOut
(Process
a Process instance
self
)

An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.

public static String

Returns:

the text of the output
getText
(Process
a Process instance
self
)

Read the text of the output stream of the Process.

public static Writer

Returns:

a Writer
leftShift
(Process
a Process instance
self
,
Object
a value to append
value
)

Overloads the left shift operator (<<) to provide an append mechanism to pipe data to a Process.

public static OutputStream

Returns:

an OutputStream
leftShift
(Process
a Process instance
self
,
byte[]
data to append
value
)

Overloads the left shift operator to provide an append mechanism to pipe into a Process

public static Process

Returns:

the second Process to allow chaining
or
(final Process
a Process instance
left
,
final Process
a Process to pipe output to
right
)

Overrides the or operator to allow one Process to asynchronously pipe data to another Process.

public static Process

Returns:

the second Process to allow chaining
pipeTo
(final Process
a Process instance
left
,
final Process
a Process to pipe output to
right
)

Allows one Process to asynchronously pipe data to another Process.

private static String[]
stringify(final List<E> orig)

public static void
waitForOrKill(Process
a Process
self
,
long
the number of milliseconds to wait before stopping the process
numberOfMillis
)

Wait for the process to finish during a certain amount of time, otherwise stops the process.

public static void
waitForProcessOutput(Process
a Process
self
)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.

public static void
waitForProcessOutput(Process
a Process
self
,
Appendable
an Appendable to capture the process stdout
output
,
Appendable
an Appendable to capture the process stderr
error
)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.

public static void
waitForProcessOutput(Process
a Process
self
,
OutputStream
an OutputStream to capture the process stdout
output
,
OutputStream
an OutputStream to capture the process stderr
error
)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.

public static void
withOutputStream(final Process
a Process
self
,
final Closure<V>
a closure
closure
)

Creates a new buffered OutputStream as stdin for this process, passes it to the closure, and ensures the stream is flushed and closed after the closure returns.

public static void
withWriter(final Process
a Process
self
,
final Closure<V>
a closure
closure
)

Creates a new BufferedWriter as stdin for this process, passes it to the closure, and ensures the stream is flushed and closed after the closure returns.

Inherited from org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport:
cloneSimilarCollectioncloneSimilarMapcloseQuietlycloseWithWarningcreateSimilarArraycreateSimilarCollectioncreateSimilarCollectioncreateSimilarCollectioncreateSimilarListcreateSimilarMapcreateSimilarOrDefaultCollectioncreateSimilarQueuecreateSimilarSetnormaliseIndexsameTypesubListBorderssubListBorderstryClosewriteUTF16BomIfRequiredwriteUTF16BomIfRequiredwriteUTF16BomIfRequiredwriteUTF16BomIfRequired

Constructor Detail

ProcessGroovyMethodsback to summary
public ProcessGroovyMethods()

Method Detail

closeStreamsback to summary
public static void closeStreams(Process self)

Closes all the streams associated with the process (ignoring any IOExceptions).

Parameters
self:Process

a Process

Since
2.1
consumeProcessErrorStreamback to summary
public static Thread consumeProcessErrorStream(Process self, OutputStream err)

Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer. The processed stream data is appended to the supplied OutputStream. A new Thread is started, so this method will return immediately.

Parameters
self:Process

a Process

err:OutputStream

an OutputStream to capture the process stderr

Returns:Thread

the Thread

Since
1.5.2
consumeProcessErrorStreamback to summary
public static Thread consumeProcessErrorStream(Process self, Appendable error)

Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer. The processed stream data is appended to the supplied Appendable. A new Thread is started, so this method will return immediately.

Parameters
self:Process

a Process

error:Appendable

an Appendable to capture the process stderr

Returns:Thread

the Thread

Since
1.7.5
consumeProcessOutputback to summary
public static void consumeProcessOutput(Process self)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer. The stream data is thrown away but blocking due to a full output buffer is avoided. Use this method if you don't care about the standard or error output and just want the process to run silently - use carefully however, because since the stream data is thrown away, it might be difficult to track down when something goes wrong. For this, two Threads are started, so this method will return immediately.

Parameters
self:Process

a Process

Since
1.0
consumeProcessOutputback to summary
public static void consumeProcessOutput(Process self, Appendable output, Appendable error)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer. The processed stream data is appended to the supplied Appendable. For this, two Threads are started, so this method will return immediately. The threads will not be join()ed, even if waitFor() is called. To wait for the output to be fully consumed call waitForProcessOutput().

Parameters
self:Process

a Process

output:Appendable

an Appendable to capture the process stdout

error:Appendable

an Appendable to capture the process stderr

Since
1.7.5
consumeProcessOutputback to summary
public static void consumeProcessOutput(Process self, OutputStream output, OutputStream error)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer. The processed stream data is appended to the supplied OutputStream. For this, two Threads are started, so this method will return immediately. The threads will not be join()ed, even if waitFor() is called. To wait for the output to be fully consumed call waitForProcessOutput().

Parameters
self:Process

a Process

output:OutputStream

an OutputStream to capture the process stdout

error:OutputStream

an OutputStream to capture the process stderr

Since
1.5.2
consumeProcessOutputStreamback to summary
public static Thread consumeProcessOutputStream(Process self, Appendable output)

Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer. The processed stream data is appended to the supplied Appendable. A new Thread is started, so this method will return immediately.

Parameters
self:Process

a Process

output:Appendable

an Appendable to capture the process stdout

Returns:Thread

the Thread

Since
1.7.5
consumeProcessOutputStreamback to summary
public static Thread consumeProcessOutputStream(Process self, OutputStream output)

Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer. The processed stream data is appended to the supplied OutputStream. A new Thread is started, so this method will return immediately.

Parameters
self:Process

a Process

output:OutputStream

an OutputStream to capture the process stdout

Returns:Thread

the Thread

Since
1.5.2
executeback to summary
public static Process execute(final String self) throws IOException

Executes the command specified by self as a command-line process.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
self:String

a command line String

Returns:Process

the Process which has just started for this command line representation

Exceptions
IOException:
if an IOException occurs.
Since
1.0
executeback to summary
public static Process execute(final String self, final String[] envp, final File dir) throws IOException

Executes the command specified by self with environment defined by envp and under the working directory dir.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
self:String

a command line String to be executed.

envp:String[]

an array of Strings, each element of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.

dir:File

the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.

Returns:Process

the Process which has just started for this command line representation.

Exceptions
IOException:
if an IOException occurs.
Since
1.0
executeback to summary
public static Process execute(final String self, final List<E> envp, final File dir) throws IOException

Executes the command specified by self with environment defined by envp and under the working directory dir.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
self:String

a command line String to be executed.

envp:List<E>

a List of Objects (converted to Strings using toString), each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.

dir:File

the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.

Returns:Process

the Process which has just started for this command line representation.

Exceptions
IOException:
if an IOException occurs.
Since
1.0
executeback to summary
public static Process execute(final String[] commandArray) throws IOException

Executes the command specified by the given String array. The first item in the array is the command; the others are the parameters.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
commandArray:String[]

an array of String containing the command name and parameters as separate items in the array.

Returns:Process

the Process which has just started for this command line representation.

Exceptions
IOException:
if an IOException occurs.
Since
1.0
executeback to summary
public static Process execute(final String[] commandArray, final String[] envp, final File dir) throws IOException

Executes the command specified by the String array given in the first parameter, with the environment defined by envp and under the working directory dir. The first item in the array is the command; the others are the parameters.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
commandArray:String[]

an array of String containing the command name and parameters as separate items in the array.

envp:String[]

an array of Strings, each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.

dir:File

the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.

Returns:Process

the Process which has just started for this command line representation.

Exceptions
IOException:
if an IOException occurs.
Since
1.7.1
executeback to summary
public static Process execute(final String[] commandArray, final List<E> envp, final File dir) throws IOException

Executes the command specified by the String array given in the first parameter, with the environment defined by envp and under the working directory dir. The first item in the array is the command; the others are the parameters.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
commandArray:String[]

an array of String containing the command name and parameters as separate items in the array.

envp:List<E>

a List of Objects (converted to Strings using toString), each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.

dir:File

the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.

Returns:Process

the Process which has just started for this command line representation.

Exceptions
IOException:
if an IOException occurs.
Since
1.7.1
executeback to summary
public static Process execute(final List<E> commands) throws IOException

Executes the command specified by the given list. The toString() method is called for each item in the list to convert into a resulting String. The first item in the list is the command the others are the parameters.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
commands:List<E>

a list containing the command name and parameters as separate items in the list.

Returns:Process

the Process which has just started for this command line representation.

Exceptions
IOException:
if an IOException occurs.
Since
1.0
executeback to summary
public static Process execute(final List<E> commands, final String[] envp, final File dir) throws IOException

Executes the command specified by the given list, with the environment defined by envp and under the working directory dir. The first item in the list is the command; the others are the parameters. The toString() method is called on items in the list to convert them to Strings.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
commands:List<E>

a List containing the command name and parameters as separate items in the list.

envp:String[]

an array of Strings, each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.

dir:File

the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.

Returns:Process

the Process which has just started for this command line representation.

Exceptions
IOException:
if an IOException occurs.
Since
1.7.1
executeback to summary
public static Process execute(final List<E> commands, final List<E> envp, final File dir) throws IOException

Executes the command specified by the given list, with the environment defined by envp and under the working directory dir. The first item in the list is the command; the others are the parameters. The toString() method is called on items in the list to convert them to Strings.

For more control over Process construction you can use java.lang.ProcessBuilder.

Parameters
commands:List<E>

a List containing the command name and parameters as separate items in the list.

envp:List<E>

a List of Objects (converted to Strings using toString), each member of which has environment variable settings in the format name=value, or null if the subprocess should inherit the environment of the current process.

dir:File

the working directory of the subprocess, or null if the subprocess should inherit the working directory of the current process.

Returns:Process

the Process which has just started for this command line representation.

Exceptions
IOException:
if an IOException occurs.
Since
1.7.1
getErrback to summary
public static InputStream getErr(Process self)

An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.

Parameters
self:Process

a Process instance

Returns:InputStream

the error InputStream for the process

Since
1.0
getInback to summary
public static InputStream getIn(Process self)

An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.

Parameters
self:Process

a Process instance

Returns:InputStream

the InputStream for the process

Since
1.0
getOutback to summary
public static OutputStream getOut(Process self)

An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.

Parameters
self:Process

a Process instance

Returns:OutputStream

the OutputStream for the process

Since
1.0
getTextback to summary
public static String getText(Process self) throws IOException

Read the text of the output stream of the Process. Closes all the streams associated with the process after retrieving the text.

Parameters
self:Process

a Process instance

Returns:String

the text of the output

Exceptions
IOException:
if an IOException occurs.
Since
1.0
leftShiftback to summary
public static Writer leftShift(Process self, Object value) throws IOException

Overloads the left shift operator (<<) to provide an append mechanism to pipe data to a Process.

Parameters
self:Process

a Process instance

value:Object

a value to append

Returns:Writer

a Writer

Exceptions
IOException:
if an IOException occurs.
Since
1.0
leftShiftback to summary
public static OutputStream leftShift(Process self, byte[] value) throws IOException

Overloads the left shift operator to provide an append mechanism to pipe into a Process

Parameters
self:Process

a Process instance

value:byte[]

data to append

Returns:OutputStream

an OutputStream

Exceptions
IOException:
if an IOException occurs.
Since
1.0
orback to summary
public static Process or(final Process left, final Process right) throws IOException

Overrides the or operator to allow one Process to asynchronously pipe data to another Process.

Parameters
left:Process

a Process instance

right:Process

a Process to pipe output to

Returns:Process

the second Process to allow chaining

Exceptions
IOException:
if an IOException occurs.
Since
1.5.1
pipeToback to summary
public static Process pipeTo(final Process left, final Process right) throws IOException

Allows one Process to asynchronously pipe data to another Process.

Parameters
left:Process

a Process instance

right:Process

a Process to pipe output to

Returns:Process

the second Process to allow chaining

Exceptions
IOException:
if an IOException occurs.
Since
1.5.2
stringifyback to summary
private static String[] stringify(final List<E> orig)
waitForOrKillback to summary
public static void waitForOrKill(Process self, long numberOfMillis)

Wait for the process to finish during a certain amount of time, otherwise stops the process.

Parameters
self:Process

a Process

numberOfMillis:long

the number of milliseconds to wait before stopping the process

Since
1.0
waitForProcessOutputback to summary
public static void waitForProcessOutput(Process self)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer. The stream data is thrown away but blocking due to a full output buffer is avoided. Use this method if you don't care about the standard or error output and just want the process to run silently - use carefully however, because since the stream data is thrown away, it might be difficult to track down when something goes wrong. For this, two Threads are started, but join()ed, so we wait. As implied by the waitFor... name, we also wait until we finish as well. Finally, the output and error streams are closed.

Parameters
self:Process

a Process

Since
1.6.5
waitForProcessOutputback to summary
public static void waitForProcessOutput(Process self, Appendable output, Appendable error)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer. The processed stream data is appended to the supplied Appendable. For this, two Threads are started, but join()ed, so we wait. As implied by the waitFor... name, we also wait until we finish as well. Finally, the input, output and error streams are closed.

Parameters
self:Process

a Process

output:Appendable

an Appendable to capture the process stdout

error:Appendable

an Appendable to capture the process stderr

Since
1.7.5
waitForProcessOutputback to summary
public static void waitForProcessOutput(Process self, OutputStream output, OutputStream error)

Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer. The processed stream data is appended to the supplied OutputStream. For this, two Threads are started, but join()ed, so we wait. As implied by the waitFor... name, we also wait until we finish as well. Finally, the input, output and error streams are closed.

Parameters
self:Process

a Process

output:OutputStream

an OutputStream to capture the process stdout

error:OutputStream

an OutputStream to capture the process stderr

Since
1.6.5
withOutputStreamback to summary
public static void withOutputStream(final Process self, final Closure<V> closure)

Creates a new buffered OutputStream as stdin for this process, passes it to the closure, and ensures the stream is flushed and closed after the closure returns. A new Thread is started, so this method will return immediately.

Parameters
self:Process

a Process

closure:Closure<V>

a closure

Since
1.5.2
withWriterback to summary
public static void withWriter(final Process self, final Closure<V> closure)

Creates a new BufferedWriter as stdin for this process, passes it to the closure, and ensures the stream is flushed and closed after the closure returns. A new Thread is started, so this method will return immediately.

Parameters
self:Process

a Process

closure:Closure<V>

a closure

Since
1.5.2
org.codehaus.groovy.runtime back to summary

private Class ProcessGroovyMethods.ByteDumper

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv final InputStream
pack-priv final OutputStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inback to summary
pack-priv final InputStream in
outback to summary
pack-priv final OutputStream out

Constructor Detail

ByteDumperback to summary
public ByteDumper(InputStream in, OutputStream out)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

org.codehaus.groovy.runtime back to summary

protected Class ProcessGroovyMethods.ProcessRunner

extends Object
implements Runnable
Class Inheritance
  • java.lang.Object
  • org.codehaus.groovy.runtime.ProcessGroovyMethods.ProcessRunner
All Implemented Interfaces
java.lang.Runnable

A Runnable which waits for a process to complete together with a notification scheme allowing another thread to wait a maximum number of seconds for the process to complete before killing it.
Since
1.0

Field Summary

Modifier and TypeField and Description
private boolean
pack-priv Process

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
public synchronized void
waitForOrKill(long millis)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

finishedback to summary
private boolean finished
processback to summary
pack-priv Process process

Constructor Detail

ProcessRunnerback to summary
public ProcessRunner(Process process)

Method Detail

doProcessWaitback to summary
private void doProcessWait()
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

waitForOrKillback to summary
public synchronized void waitForOrKill(long millis)
org.codehaus.groovy.runtime back to summary

private Class ProcessGroovyMethods.TextDumper

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv final Appendable
pack-priv final InputStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appback to summary
pack-priv final Appendable app
inback to summary
pack-priv final InputStream in

Constructor Detail

TextDumperback to summary
public TextDumper(InputStream in, Appendable app)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.