Package org.eclipse.cdt.utils.spawner
Class Spawner
java.lang.Object
java.lang.Process
org.eclipse.cdt.utils.spawner.Spawner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionintDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeprecated.Do not use this method it splits command line arguments on whitespace with no regard to quoting rules.protectedExecutes the specified command and arguments in a separate process.protectedprotectedExecutes the specified command and arguments in a separate process with the specified environment.protectedprotectedprotectedExecutes the specified command and arguments in a separate process with the specified environment and working directory.protectedprotectedDeprecated.Do not use this method it splits command line arguments on whitespace with no regard to quoting rules.protectedDeprecated.Do not use this method it splits command line arguments on whitespace with no regard to quoting rules.protectedDeprecated.Do not use this method it splits command line arguments on whitespace with no regard to quoting rules. -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()See java.lang.Process#destroy (); Clients are responsible for explicitly closing any streams that they have requested through getErrorStream(), getInputStream() or getOutputStream()voidexec_detached(String[] cmdarray, String[] envp, String dirpath) intexec2(String[] cmdarray, String[] envp, String dir, Spawner.IChannel[] chan, String slaveName, int masterFD, boolean console) Native method when executing with a terminal emulation.intSee java.lang.Process#exitValue ();protected voidfinalize()See java.lang.Process#getErrorStream (); The client is responsible for closing the stream explicitly.See java.lang.Process#getInputStream (); The client is responsible for closing the stream explicitly.See java.lang.Process#getOutputStream (); The client is responsible for closing the stream explicitly.inthangup()intOn Windows, interrupt the spawned program by using Cygwin's utility 'kill -SIGINT' if it's a Cgywin program, otherwise send it a CTRL-C.intOn Windows, interrupt the spawned program by send it a CTRL-C (even if it's a Cygwin program).booleanintkill()longpid()pty()intraise(int sig) intraise(int processID, int sig) Native method to drop a signal on the process with pid.intintwaitFor()See java.lang.Process#waitFor ();intwaitFor(int processID) Native method to wait(3) for process to terminate.Methods inherited from class java.lang.Process
children, descendants, destroyForcibly, errorReader, errorReader, info, inputReader, inputReader, isAlive, onExit, outputWriter, outputWriter, supportsNormalTermination, toHandle, waitFor
-
Field Details
-
NOOP
Deprecated, for removal: This API element is subject to removal in a future version. -
HUP
Deprecated, for removal: This API element is subject to removal in a future version. -
KILL
Deprecated, for removal: This API element is subject to removal in a future version. -
TERM
Deprecated, for removal: This API element is subject to removal in a future version. -
INT
Deprecated, for removal: This API element is subject to removal in a future version. -
CTRLC
Deprecated, for removal: This API element is subject to removal in a future version.- Since:
- 5.2
-
-
Constructor Details
-
Spawner
Deprecated.Do not use this method it splits command line arguments on whitespace with no regard to quoting rules. See Bug 573677- Throws:
IOException
-
Spawner
- Throws:
IOException
-
Spawner
protected Spawner(String[] cmdarray, String[] envp, File dir, int gracefulExitTimeMs) throws IOException Executes the specified command and arguments in a separate process with the specified environment and working directory.- Throws:
IOException- Since:
- 6.2
-
Spawner
- Throws:
IOException
-
Spawner
protected Spawner(String[] cmdarray, String[] envp, File dir, PTY pty, int gracefulExitTimeMs) throws IOException - Throws:
IOException- Since:
- 6.2
-
Spawner
Deprecated.Do not use this method it splits command line arguments on whitespace with no regard to quoting rules. See Bug 573677Executes the specified string command in a separate process.- Throws:
IOException
-
Spawner
Executes the specified command and arguments in a separate process.- Throws:
IOException
-
Spawner
- Throws:
IOException- Since:
- 6.2
-
Spawner
Executes the specified command and arguments in a separate process with the specified environment.- Throws:
IOException
-
Spawner
- Throws:
IOException- Since:
- 6.2
-
Spawner
Deprecated.Do not use this method it splits command line arguments on whitespace with no regard to quoting rules. See Bug 573677Executes the specified string command in a separate process with the specified environment.- Throws:
IOException
-
Spawner
Deprecated.Do not use this method it splits command line arguments on whitespace with no regard to quoting rules. See Bug 573677Executes the specified string command in a separate process with the specified environment and working directory.- Throws:
IOException
-
-
Method Details
-
finalize
-
getInputStream
See java.lang.Process#getInputStream (); The client is responsible for closing the stream explicitly.- Specified by:
getInputStreamin classProcess
-
getOutputStream
See java.lang.Process#getOutputStream (); The client is responsible for closing the stream explicitly.- Specified by:
getOutputStreamin classProcess
-
getErrorStream
See java.lang.Process#getErrorStream (); The client is responsible for closing the stream explicitly.- Specified by:
getErrorStreamin classProcess
-
waitFor
See java.lang.Process#waitFor ();- Specified by:
waitForin classProcess- Throws:
InterruptedException
-
exitValue
public int exitValue()See java.lang.Process#exitValue (); -
destroy
public void destroy()See java.lang.Process#destroy (); Clients are responsible for explicitly closing any streams that they have requested through getErrorStream(), getInputStream() or getOutputStream() -
pid
public long pid() -
interrupt
public int interrupt()On Windows, interrupt the spawned program by using Cygwin's utility 'kill -SIGINT' if it's a Cgywin program, otherwise send it a CTRL-C. If Cygwin's 'kill' command is not available, send a CTRL-C. On linux, interrupt it by raising a SIGINT. -
interruptCTRLC
public int interruptCTRLC()On Windows, interrupt the spawned program by send it a CTRL-C (even if it's a Cygwin program). On linux, interrupt it by raising a SIGINT.- Since:
- 5.2
-
hangup
public int hangup() -
kill
public int kill() -
terminate
public int terminate() -
isRunning
public boolean isRunning() -
pty
- Returns:
- the current pty instance for this spawner
- Since:
- 6.4
-
exec_detached
- Throws:
IOException
-
exec2
public int exec2(String[] cmdarray, String[] envp, String dir, Spawner.IChannel[] chan, String slaveName, int masterFD, boolean console) throws IOException Native method when executing with a terminal emulation.- Throws:
IOException- Restriction:
- This method is not intended to be referenced by clients.
-
raise
public int raise(int processID, int sig) Native method to drop a signal on the process with pid. -
raise
public int raise(int sig) - Since:
- 6.2
-
waitFor
public int waitFor(int processID) Native method to wait(3) for process to terminate.- Restriction:
- This method is not intended to be referenced by clients.
-