public final class PipeExecutor extends Object implements EngineExecutor
This executor uses an external program to produce results from inputs. It communicates with this program thru 'pipes' on the program's standard input ('stdin'), output ('stdout') and error ('stderr') streams.
The program is expected to loop on the requests until it receives a line containing a single field holding only the digit '0'.
Modifier and Type | Field and Description |
---|---|
static String |
ARG_PARAM
An argument for the process.
|
static String |
CHARSET_PARAM
The character set for the program execution.
|
static String |
COMMAND_PARAM
The operating system command used to activate the process.
|
static String |
DEFAULT_CHARSET
Default character set.
|
static String |
DIRECTORY_PARAM
Specifies the working directory for the program execution.
|
static String |
KEEP_PROCESS_PARAM
The number of milliseconds to keep the process active between
invocations.
|
static String |
KILL_DELAY_PARAM
The delay before killing a process after closing its input.
|
static String |
PROGRAM_PARAM
The path to the program file.
|
static String |
SET_PARAM
Sets an environment variable.
|
static String |
TIME_LIMIT_PARAM
The time limit to produce a result.
|
Constructor and Description |
---|
PipeExecutor() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this.
|
void |
disposeContext(Serializable context)
Disposes of a context.
|
List<PointValue> |
execute(ResultValue resultValue,
String[] params,
Serializable context)
Executes the processing of a request for a result value.
|
Serializable |
newContext(Params params,
Logger logger)
Returns a new context.
|
boolean |
setUp(String name,
Params params,
Config config,
Logger logger)
Sets up this engine executor.
|
void |
tearDown()
Tears down what has been set up.
|
public static final String ARG_PARAM
public static final String CHARSET_PARAM
public static final String COMMAND_PARAM
public static final String DEFAULT_CHARSET
public static final String DIRECTORY_PARAM
public static final String KEEP_PROCESS_PARAM
public static final String KILL_DELAY_PARAM
public static final String PROGRAM_PARAM
public static final String SET_PARAM
public static final String TIME_LIMIT_PARAM
public void close()
close
in interface EngineExecutor
public void disposeContext(Serializable context)
disposeContext
in interface EngineExecutor
context
- The context.public List<PointValue> execute(ResultValue resultValue, String[] params, Serializable context) throws ServiceNotReadyException
execute
in interface EngineExecutor
resultValue
- The requested result.params
- Result parameters.context
- The context.ServiceNotReadyException
public Serializable newContext(Params params, Logger logger)
newContext
in interface EngineExecutor
params
- The caller's parameters.logger
- The caller's logger.public boolean setUp(String name, Params params, Config config, Logger logger)
setUp
in interface EngineExecutor
name
- The caller's name.params
- The caller's parameters.config
- The configuration.logger
- The caller's logger.public void tearDown()
tearDown
in interface EngineExecutor
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.