public abstract class ProcessHandler extends UserDataHolderBase
Modifier and Type | Field and Description |
---|---|
static Key<java.lang.Boolean> |
SILENTLY_DESTROY_ON_CLOSE
Deprecated.
|
static Key<java.lang.Boolean> |
TERMINATION_REQUESTED |
Modifier | Constructor and Description |
---|---|
protected |
ProcessHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addProcessListener(ProcessListener listener) |
void |
addProcessListener(ProcessListener listener,
Disposable parentDisposable) |
void |
destroyProcess()
Destroys the process if
isStartNotified() returns true ,
or postpones the action until startNotify() is called. |
protected abstract void |
destroyProcessImpl()
Performs process destruction.
|
abstract boolean |
detachIsDefault() |
void |
detachProcess()
Detaches the process if
isStartNotified() returns true ,
or postpones the action until startNotify() is called. |
protected abstract void |
detachProcessImpl()
Performs detaching process.
|
java.lang.Integer |
getExitCode() |
abstract java.io.OutputStream |
getProcessInput() |
boolean |
isProcessTerminated() |
boolean |
isProcessTerminating() |
boolean |
isSilentlyDestroyOnClose() |
boolean |
isStartNotified() |
protected void |
notifyProcessDetached() |
protected void |
notifyProcessTerminated(int exitCode) |
void |
notifyTextAvailable(java.lang.String text,
Key outputType) |
void |
removeProcessListener(ProcessListener listener) |
void |
startNotify() |
boolean |
waitFor()
Wait for process execution.
|
boolean |
waitFor(long timeoutInMilliseconds) |
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
@Deprecated public static final Key<java.lang.Boolean> SILENTLY_DESTROY_ON_CLOSE
public static final Key<java.lang.Boolean> TERMINATION_REQUESTED
public void startNotify()
protected abstract void destroyProcessImpl()
This is an internal implementation of destroyProcess()
. All sub-classes must implement this method and perform the
destruction in this method. This method is called from destroyProcess()
and it can be in any thread including the
event dispatcher thread. You should avoid doing any expensive operation directly in this method. Instead, you may post the work to
background thread and return without waiting for it. If the performed destruction led to process termination,
notifyProcessTerminated(int)
must be called in any thread (not necessary from this method).
protected abstract void detachProcessImpl()
This is an internal implementation of detachProcess()
. All sub-classes must implement this method and perform the
detaching in this method. This method is called from detachProcess()
and it can be in any thread including the
event dispatcher thread. You should avoid doing any expensive operation directly in this method. Instead, you may post the work to
background thread and return without waiting for it. If the performed detaching is completed,
notifyProcessTerminated(int)
must be called in any thread (not necessary from this method).
public abstract boolean detachIsDefault()
public boolean waitFor()
public boolean waitFor(long timeoutInMilliseconds)
public void destroyProcess()
isStartNotified()
returns true
,
or postpones the action until startNotify()
is called.
It changes the process handler's state and isProcessTerminating()
becomes true. This method may return without waiting for
the process termination. Upon the completion of the process termination, isProcessTerminated()
becomes true.
public void detachProcess()
isStartNotified()
returns true
,
or postpones the action until startNotify()
is called.
It changes the process handler's state and isProcessTerminating()
becomes true. This method may return without waiting for
detaching the process. Upon the completion of the detaching, isProcessTerminated()
becomes true.
public boolean isProcessTerminated()
public boolean isProcessTerminating()
public java.lang.Integer getExitCode()
public void addProcessListener(ProcessListener listener)
public void addProcessListener(ProcessListener listener, Disposable parentDisposable)
public void removeProcessListener(ProcessListener listener)
protected void notifyProcessDetached()
protected void notifyProcessTerminated(int exitCode)
public void notifyTextAvailable(java.lang.String text, Key outputType)
public abstract java.io.OutputStream getProcessInput()
public boolean isStartNotified()
public boolean isSilentlyDestroyOnClose()