|
Brooklyn | |||||||
FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.util.task.system.ProcessTaskStub
brooklyn.util.task.system.ProcessTaskWrapper
public abstract class ProcessTaskWrapper extends ProcessTaskStub
Wraps a fully constructed process task, and allows callers to inspect status. Note that methods in here such as getStdout() will return partially completed streams while the task is ongoing (and exit code will be null). You can block() or get() as conveniences on the underlying getTask().
Nested Class Summary | |
---|---|
protected class |
ProcessTaskWrapper.ProcessTaskInternalJob
|
Field Summary | |
---|---|
protected java.lang.Integer |
exitCode
|
protected java.io.ByteArrayOutputStream |
stderr
|
protected java.io.ByteArrayOutputStream |
stdout
|
Fields inherited from class ProcessTaskStub | |
---|---|
commands, completionListeners, config, extraErrorMessage, machine, requireExitCodeZero, returnResultTransformation, returnType, runAsRoot, runAsScript, shellEnvironment, summary |
Constructor Summary | |
protected ProcessTaskWrapper(AbstractProcessTaskFactory constructor)
|
Method Summary | |
---|---|
Task
|
asTask()
|
ProcessTaskWrapper
|
block()
blocks until the task completes; does not throw |
RET
|
get()
blocks and gets the result, throwing if there was an exception |
java.lang.Integer
|
getExitCode()
|
java.lang.String
|
getStderr()
|
byte[]
|
getStderrBytes()
|
java.lang.String
|
getStdout()
|
byte[]
|
getStdoutBytes()
|
Task
|
getTask()
|
boolean
|
isDone()
true iff the process has completed (with or without failure) |
protected void
|
run(ConfigBag config)
|
protected java.lang.String
|
taskTypeShortName()
|
java.lang.String
|
toString()
|
Methods inherited from class ProcessTaskStub | |
---|---|
getCommands, getCompletionListeners, getConfig, getMachine, getShellEnvironment, getSummary, toString |
Field Detail |
---|
protected java.lang.Integer exitCode
protected java.io.ByteArrayOutputStream stderr
protected java.io.ByteArrayOutputStream stdout
Constructor Detail |
---|
protected ProcessTaskWrapper(AbstractProcessTaskFactory constructor) { protected ProcessTaskWrapper(AbstractProcessTaskFactory constructor)
Method Detail |
---|
public TaskasTask() { public Task asTask()
public ProcessTaskWrapper block()
public RET get()
public java.lang.Integer getExitCode()
public java.lang.String getStderr()
public byte[] getStderrBytes()
public java.lang.String getStdout()
public byte[] getStdoutBytes()
public TaskgetTask() { public Task getTask()
public boolean isDone()
protected void run(ConfigBag config)
protected java.lang.String taskTypeShortName()
} public java.lang.String toString()
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.