The major parts of this API has been refactored to External Execution Base API
in version 1.43. This API is now to be used in situations where the base
support is not sufficient such as when you need progress and output window
integration.

To see the simplest usage of this API to handle external process
including input and output integration see documentation of
ExecutionService

The External Execution module provides the
ExternalExecutionAPI
that contains support for execution of external processes in the IDE. It also
provide support class for the actual creation of the external process
and support for destroying the process tree.
There is also abstraction of
process builder. The builder is now deprecated and replaced by one in
External Execution Base API.

Another exported API
ExternalExecutionInputAPI
define interfaces for input processing (character or line based)
and provides common implementations of these with factory methods.
This API is now deprecated in favor of External Execution Base API.

The SPI
ExternalExecutionSPI
allows different implementations of process builder.
This API is now deprecated in favor of External Execution Base API.

There is also SPI allowing to
register support for destroying the process tree
ExternalExecutionDestroySPI.
This API is now deprecated in favor of org.netbeans.spi.extexecution.base.ProcessesImplementation
from External Execution Base API.

The ExternalExecutionOpenSPI
allows implementation module to determine particular way of file or HTTP
URL opening in predefined covertors. It also makes options dialog opening
pluggable.

This API/SPI allow third party plugins (such as JRebel) to
register extenders of process startup. The interested clients
such as projects or servers may optionaly query such
extenders and pass additional arguments to the process.

Use Cases

Execution of an external process

Client needs to execute an external process and handle process streams and
display the output in the output tab.

In order to achieve this client creates the
ExecutionDescriptor.
Via this object client configures all the UI behaviour of the subsequent
execution. As a next step client creates the
ExecutionService
itself and calls run to execute the job. Run can be called multiple times.
The output and input streams are presented in output tab. Additional
processing and printing conversion can be configured in descriptor through
interfaces described in following usecases.

Processing the input

Client needs to process character
data coming from stream, file or other source. This usecase should
be solved by External Execution Base API.

To abstract the source of the data client must implement
InputReader.
To abstract the data processing client must implement
InputProcessor or
LineProcessor.
For all three interfaces there are prepared common implementations (and bridge
from character based to line based processing) at these three factory classes:

To configure additional functionality specific to org.openide.windows.OutputWriter
see the next usecase.

Once the data source and processing objects are prepared client creates
InputReaderTask.
Factory methods of the InputReaderTask
can create either common task exiting on interruption or cancellation
or draining task which is trying to drain out all available data before exiting.

Printing the input

Client intends to process input lines and print them to org.openide.windows.OutputWriter.
In addition printed lines should be transformed (converted) somehow
and enriched by line listeners.