Runs a group of programs. As many of AMICO modules are implemented as standalone (Java) applications, it is convenient to have a program that can run at once all the modules that are necessary for some scenario.
java -jar "%AMICO_HOME%/bin/amico-process-runner.jar" [<conf-url>]
Configuration file contains a list of processes with command line strings that are used to create processes. Processes are automatically started, after time offset specified in the configuration file. Within command string, you can also use system variables. AMICO process runner accept both the Windows and Unix syntax for systems variables regardless of the system in runs (Windows use a form %VARIABLE_NAME%, while Unix systems use syntax $VARIABLE_NAME).
<?xml version="1.0" encoding="UTF-8"?>
<!-- Title will be displayed as process runner window caption -->
<!--
auto-start - defines if the process will be started as soon as
process runner starts, <!-- timeOffsetMs - used if auto-start is true. Starts process after given milliseconds value. Default value is 0.--> <process id="communicator"
auto-start="true" title="The
Communicator" description="Core
communication engine."> </process> <process id="rfid-reader" auto-start="true" timeOffsetMs="2000" title="RFID Reader" description="Reads RFID tags."> java -jar "%AMICO_HOME%\modules\rfid-reader\sensors-rfid.jar" COM5 localhost 3311 user-id 32 16 24 </process> <process id="face-detector" auto-start="false" title="Face Detection Sensor" description="Face detector">
"%AMICO_HOME%modules\vision\face-detection\facedetection.exe"
</process> </process-runner> |
Process runner creates a simple graphical interfaces. It also included a tabbed representation of consoles where each process has a separate tab, with text area where console output of the processes is written, and with buttons for starting and stopping the processes. NOTE: This interface appears only if you set attribute show-gui="yes" in the main configuration file.
Process runner exposes a XML-RPC interface with the following methods:
Return type | Method name | Argument(s) | Description |
string | startProcess | string processId | Starts a process with a specified ID (ID is define within the configuration file of the process runner). Always returns an empty string*. |
string | killProcess | string processId | Kills a process with a specified ID (ID is define within the configuration file of the process runner). Always returns an empty string*. |
string | restartProcess | string processId | Restarts a process with a specified ID (ID is define within the configuration file of the process runner). It kills the process first, and that starts it again. Always returns an empty string*. |
string | restartProcess | string processId, int pauseMs |
The same as the previous command, but enable waiting between killing and restarting. |
string | getProcessStatus | string processId | Return the status of the process with a specified ID (ID is define within the configuration file of the process runner). |
string | exit | Kills all running processes and stops the process runner. |
* AS XML-RPC does not support function with void return type, startProcess,
killProcess, restartProcess, and exit are defined with as
string type, but they always return an empty string.
This is simple Java program that call startProcess method using Apache Java XML-RPC library. You can also use AMICO XML-RPC interface to control the process runner.
import java.util.Vector;
public class XmlRpcTest { public static void main( String
args[] ) {
Vector params = new Vector ();
xmlrpc.execute( "amico_processes.startProcess", params );
e.printStackTrace(); } } |