Pronto ControlPronto includes a module that allows a Java application to be controlled with externally supplied instructions. It depends on the state module to provide the abstraction through which an application is controlled. The module currently provides three different control mechanisms that can be freely combined. They are:
System.in)The Controller is the core class within the control
module. Controllers use state engines as an mechanism to communicate
control events to application. The following documentation assumes
familiarity with state module. There are three basic steps in using a
controller.
The settings for a controller are provided by the application
through the satisfaction of an interface (in the spirit of the configuration module). All are extensions of
com.tomgibara.pronto.control.ControllerSettings. There
is one interface for each type of control that is supported by the
module. A settings object may implement one or more of these
interfaces. The currently supported interfaces are:
com.tomgibara.pronto.control.StdinControllerSettingscom.tomgibara.pronto.control.FileControllerSettingscom.tomgibara.pronto.control.SignalControllerSettingsControllers are created using the factory class
com.tomgibara.pronto.control.ControlFactory. The factory
is a singleton that is obtained by calling its
getInstance() method. The factory supports two methods:
one for checking whether a given interface is supported (to enable
future extensions to the module), and another to create a
Controller.
Three parameters are required to create a controller. These are:
Any number of controllers may be created from the factory.
Each Controller is created in passive state; a
controller will not start to monitor an application's environment for
control instructions until it is started. Starting a controller is
simply a case of calling the start method. Controllers may also be
stopped (and restarted). They are entirely safe for multithreaded
use.