Class ProcessManager

All Implemented Interfaces:
Iterable<ComponentType>, Channel, ComponentType, Eligible, Manager

public class ProcessManager extends Component
Provides a component that executes processes.

A process is started by firing a StartProcess event. In response, the ProcessManager starts the process and creates a ProcessManager.ProcessChannel (i.e. an {@link IOSubchannel) for communication with the process. It fires an {@link Opening} and ProcessStarted event on the newly created channel.

Data may be sent to the process’s stdin by firing Output events on the ProcessManager.ProcessChannel. As usual, these events should be fired using the channels response pipeline. Data generated by the process is provided by Input events. In order to distinguish between stdout and stderr, the events have an association with class FileDescriptor as key and an associated value of 1 (stdout) or 2 (stderr).

When the process terminated, three Closed events are fired on the ProcessManager.ProcessChannel one each for stdout and stderr (with the same association as was used for the Input events) and a as third event a ProcessExited (specialized Closed) with the process’s exit value. Note that the sequence in which these events are sent is undefined.