class SubProcess extends ProcessLike
Represents a spawn subprocess that has started and may or may not have completed.
- Annotations
- @deprecatedInheritance( ... , "0.10.4" )
- Alphabetic
- By Inheritance
- SubProcess
- ProcessLike
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new SubProcess(wrapped: Process, inputPumperThread: Option[Thread], outputPumperThread: Option[Thread], errorPumperThread: Option[Thread])
- new SubProcess(wrapped: Process, inputPumperThread: Option[Thread], outputPumperThread: Option[Thread], errorPumperThread: Option[Thread], shutdownGracePeriod: Long, shutdownHookMonitorThread: Option[Thread])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
close(): Unit
Alias for destroy
Alias for destroy
- Definition Classes
- SubProcess → ProcessLike → AutoCloseable
-
def
destroy(shutdownGracePeriod: Long = this.shutdownGracePeriod, async: Boolean = false): Unit
Destroys the subprocess, via the underlying JVM APIs, with configurable levels of aggressiveness:
Destroys the subprocess, via the underlying JVM APIs, with configurable levels of aggressiveness:
- shutdownGracePeriod
use this to override the default wait time for the subprocess to gracefully exit before destroying it forcibly. Defaults to the
shutdownGracePeriodthat was used to spawned the process, but can be set to 0 (i.e. force exit immediately) or -1 (i.e. never force exit) or anything in between. Typically defaults to 100 milliseconds.- async
set this to
trueif you do not want to wait on the subprocess exiting
-
def
destroy(): Unit
Attempt to destroy the subprocess (gently), via the underlying JVM APIs
Attempt to destroy the subprocess (gently), via the underlying JVM APIs
- Definition Classes
- SubProcess → ProcessLike
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val errorPumperThread: Option[Thread]
-
def
exitCode(): Int
The subprocess' exit code.
The subprocess' exit code. Conventionally, 0 exit code represents a successful termination, and non-zero exit code indicates a failure.
Throws an exception if the subprocess has not terminated
- Definition Classes
- SubProcess → ProcessLike
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val inputPumperThread: Option[Thread]
-
def
isAlive(): Boolean
Returns
trueif the subprocess is still running and has not terminatedReturns
trueif the subprocess is still running and has not terminated- Definition Classes
- SubProcess → ProcessLike
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
join(timeout: Long = -1, timeoutGracePeriod: Long = 100): Boolean
Wait up to
millisfor the ProcessLike to terminate and all stdout and stderr from the subprocess to be handled.Wait up to
millisfor the ProcessLike to terminate and all stdout and stderr from the subprocess to be handled. By default waits indefinitely; if a time limit is given, explicitly destroys the ProcessLike if it has not completed by the time the timeout has occurred.By default, a process is destroyed by sending a
SIGTERMsignal, which allows an opportunity for it to clean up any resources it was using. If the process is unresponsive to this, aSIGKILLsignal is senttimeoutGracePeriodmilliseconds later. IftimeoutGracePeriodis0, then there is noSIGTERM; if it is-1, there is noSIGKILLsent.- Definition Classes
- ProcessLike
- Note
the issuing of
SIGTERMinstead ofSIGKILLis implementation dependent on your JVM version. Pre-Java 9, noSIGTERMmay be issued. Check the documentation for your JDK'sProcess.destroy.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val outputPumperThread: Option[Thread]
- val shutdownGracePeriod: Long
- val shutdownHookMonitorThread: Option[Thread]
- val stderr: OutputStream
- val stdin: InputStream
- val stdout: OutputStream
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
waitFor(timeout: Long = -1): Boolean
Wait up to
millisfor the subprocess to terminate, by default waits indefinitely.Wait up to
millisfor the subprocess to terminate, by default waits indefinitely. Returnstrueif the subprocess has terminated by the time this method returns.- Definition Classes
- SubProcess → ProcessLike
- val wrapped: Process
Deprecated Value Members
-
def
destroyForcibly(): Unit
Force-destroys the ProcessLike, via the underlying JVM APIs
Force-destroys the ProcessLike, via the underlying JVM APIs
- Definition Classes
- SubProcess → ProcessLike
- Annotations
- @deprecated
- Deprecated
Use destroy(shutdownGracePeriod = 0)
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated