public class ServerProcess extends Process
| Modifier and Type | Field and Description |
|---|---|
static OutputStream |
DISCARDING
An output stream that discards all written output.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
int |
exitValue() |
Thread |
getConsoleConsumer()
Returns the thread used to consume the standard output streams.
|
InputStream |
getErrorStream() |
InputStream |
getInputStream() |
OutputStream |
getOutputStream() |
boolean |
isInheritedStreams()
Returns
true if the streams are inherited. |
static ServerProcess |
start(org.wildfly.core.launcher.CommandBuilder commandBuilder)
Starts a server process based.
|
static ServerProcess |
start(org.wildfly.core.launcher.CommandBuilder commandBuilder,
Map<String,String> env)
Starts a server process based.
|
static ServerProcess |
start(org.wildfly.core.launcher.CommandBuilder commandBuilder,
Map<String,String> env,
OutputStream stdout)
Starts a server process based.
|
int |
waitFor() |
destroyForcibly, isAlive, waitForpublic static final OutputStream DISCARDING
public static ServerProcess start(org.wildfly.core.launcher.CommandBuilder commandBuilder) throws IOException
commandBuilder - the command used to start the serverIOException - if an error occurs starting the processpublic static ServerProcess start(org.wildfly.core.launcher.CommandBuilder commandBuilder, Map<String,String> env) throws IOException
commandBuilder - the command used to start the serverenv - any environment variables to add to the server processes environment variables, can be nullIOException - if an error occurs starting the processpublic static ServerProcess start(org.wildfly.core.launcher.CommandBuilder commandBuilder, Map<String,String> env, OutputStream stdout) throws IOException
If the stdout parameter is not null both standard out and standard error will be redirected to
to the output stream provided. If the parameter is null all standard streams will be inherited from the
parent process.
commandBuilder - the command used to start the serverenv - any environment variables to add to the server processes environment variables, can be nullstdout - the output stream used to consume standard out and standard error, can be nullIOException - if an error occurs starting the processpublic OutputStream getOutputStream()
getOutputStream in class Processpublic InputStream getInputStream()
getInputStream in class Processpublic InputStream getErrorStream()
getErrorStream in class Processpublic int waitFor()
throws InterruptedException
waitFor in class ProcessInterruptedExceptionpublic Thread getConsoleConsumer()
isInheritedStreams() returns
false this will return null.null if the processes inherits the streams from the parent processpublic boolean isInheritedStreams()
true if the streams are inherited.true if the streams are inherited from the parent process, otherwise falseCopyright © 2017 JBoss by Red Hat. All rights reserved.