public class ProcessExecutorClient extends AbstractProcessExecutor
ProcessExecutor implementation delegating all execution requests to a remote server (a small JVM, which can
spawn the processes more efficiently).
The sub process (the server) is executed on construction time of this object and terminated when this object's
quit() method is called.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EMMA_COVERAGE_ANNOUNCE
When the remote server has emma test coverage enabled, the started java VM outputs this message (to stdout).
|
| Constructor and Description |
|---|
ProcessExecutorClient(Configuration conf,
RMIRegistryService rmiReg,
ProcessContextRegistry contextReg,
java.lang.String tenantName)
constructs a new client, starts the
ProcessExecutorServer and connects to it. |
| Modifier and Type | Method and Description |
|---|---|
int |
execute(ProcessContext ctx)
Synchronously executes the given
ProcessContext. |
void |
quit()
Terminates this
ProcessExecutor and frees all associated resources. |
executepublic static final java.lang.String EMMA_COVERAGE_ANNOUNCE
public ProcessExecutorClient(Configuration conf,
RMIRegistryService rmiReg,
ProcessContextRegistry contextReg,
java.lang.String tenantName)
throws java.io.IOException,
java.rmi.NotBoundException
ProcessExecutorServer and connects to it.conf - the Configuration containing information how to spawn the server.rmiReg - the rmi registry to usecontextReg - the process context registry to use for call back handlingtenantName - the current tenant's namejava.io.IOException - if the sub process could not be spawned correctly or the any other communication error occurred.java.rmi.NotBoundException - if the server was not correctly bound to the rmi registrypublic void quit()
throws java.io.IOException
ProcessExecutorProcessExecutor and frees all associated resources.
Note the lifecycle of a ProcessExecutor has tenant scope, i.e. there is no need to call ProcessExecutor.quit()
except when shutting down the server (what will be done automatically).java.io.IOException - on any errorpublic int execute(ProcessContext ctx) throws java.io.IOException
ProcessExecutorProcessContext.ctx - the context to executejava.io.IOException - on eny error while executing the process.Copyright © 2018 SAP SE. All Rights Reserved.