From 3f557092b68c57d64bdeec6049c948a731e1865e Mon Sep 17 00:00:00 2001 From: Yuki Hamada Date: Fri, 27 Dec 2019 16:57:56 +0300 Subject: [PATCH] Adds javadoc to ProcessHandler's abstract methods. close #1277 GitOrigin-RevId: 5a3818898f759d9313a532163e281c2394de5daf --- .../execution/process/ProcessHandler.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/platform/util/src/com/intellij/execution/process/ProcessHandler.java b/platform/util/src/com/intellij/execution/process/ProcessHandler.java index d4aa08acdd7d..f3430c848ea4 100644 --- a/platform/util/src/com/intellij/execution/process/ProcessHandler.java +++ b/platform/util/src/com/intellij/execution/process/ProcessHandler.java @@ -61,8 +61,26 @@ public abstract class ProcessHandler extends UserDataHolderBase { } } + /** + * Performs process destruction. + * + *

This is an internal implementation of {@link #destroyProcess}. All sub-classes must implement this method and perform the + * destruction in this method. This method is called from {@link #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. Once the destruction is completed, you must call {@link #notifyProcessTerminated} + * to move the process handler's state to terminated. + */ protected abstract void destroyProcessImpl(); + /** + * Performs detaching process. + * + *

This is an internal implementation of {@link #detachProcess}. All sub-classes must implement this method and perform the + * detaching in this method. This method is called from {@link #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. Once the detaching is completed, you must call {@link #notifyProcessDetached} + * to move the process handler's state to terminated. + */ protected abstract void detachProcessImpl(); public abstract boolean detachIsDefault(); @@ -91,6 +109,12 @@ public abstract class ProcessHandler extends UserDataHolderBase { } } + /** + * Destroys a process asynchronously. + * + *

It changes the process handler's state and {@link #isProcessTerminating} becomes true. This method may return without waiting for + * the process termination. Upon the completion of the process termination, {@link #isProcessTerminated} becomes true. + */ public void destroyProcess() { myAfterStartNotifiedRunner.execute(() -> { if (myState.compareAndSet(State.RUNNING, State.TERMINATING)) { @@ -100,6 +124,12 @@ public abstract class ProcessHandler extends UserDataHolderBase { }); } + /** + * Detaches a process asynchronously. + * + *

It changes the process handler's state and {@link #isProcessTerminating} becomes true. This method may return without waiting for + * detaching the process. Upon the completion of the detaching, {@link #isProcessTerminated} becomes true. + */ public void detachProcess() { myAfterStartNotifiedRunner.execute(() -> { if (myState.compareAndSet(State.RUNNING, State.TERMINATING)) {