Class ProcessExecutorClient
- java.lang.Object
-
- de.hybris.platform.mediaconversion.os.process.AbstractProcessExecutor
-
- de.hybris.platform.mediaconversion.os.process.impl.ProcessExecutorClient
-
- All Implemented Interfaces:
ProcessExecutor
public class ProcessExecutorClient extends AbstractProcessExecutor
ProcessExecutorimplementation 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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEMMA_COVERAGE_ANNOUNCEWhen the remote server has emma test coverage enabled, the started java VM outputs this message (to stdout).
-
Constructor Summary
Constructors Constructor Description ProcessExecutorClient(org.apache.commons.configuration.Configuration conf, RMIRegistryService rmiReg, ProcessContextRegistry contextReg, java.lang.String tenantName)constructs a new client, starts theProcessExecutorServerand connects to it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intexecute(ProcessContext ctx)Synchronously executes the givenProcessContext.voidquit()Terminates thisProcessExecutorand frees all associated resources.-
Methods inherited from class de.hybris.platform.mediaconversion.os.process.AbstractProcessExecutor
execute
-
-
-
-
Field Detail
-
EMMA_COVERAGE_ANNOUNCE
public static final java.lang.String EMMA_COVERAGE_ANNOUNCE
When the remote server has emma test coverage enabled, the started java VM outputs this message (to stdout). This message must be recognized and skipped to correctly receive the server's proprietary start message.
-
-
Constructor Detail
-
ProcessExecutorClient
public ProcessExecutorClient(org.apache.commons.configuration.Configuration conf, RMIRegistryService rmiReg, ProcessContextRegistry contextReg, java.lang.String tenantName) throws java.io.IOException, java.rmi.NotBoundExceptionconstructs a new client, starts theProcessExecutorServerand connects to it.- Parameters:
conf- theConfigurationcontaining 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 name- Throws:
java.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 registry
-
-
Method Detail
-
quit
public void quit() throws java.io.IOExceptionDescription copied from interface:ProcessExecutorTerminates thisProcessExecutorand frees all associated resources. Note the lifecycle of aProcessExecutorhas tenant scope, i.e. there is no need to callProcessExecutor.quit()except when shutting down the server (what will be done automatically).- Throws:
java.io.IOException- on any error
-
execute
public int execute(ProcessContext ctx) throws java.io.IOException
Description copied from interface:ProcessExecutorSynchronously executes the givenProcessContext.- Parameters:
ctx- the context to execute- Returns:
- the exit code of the underlying os process.
- Throws:
java.io.IOException- on eny error while executing the process.
-
-