Class ProcessExecutorClient
java.lang.Object
de.hybris.platform.mediaconversion.os.process.AbstractProcessExecutor
de.hybris.platform.mediaconversion.os.process.impl.ProcessExecutorClient
- All Implemented Interfaces:
ProcessExecutor
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhen the remote server has emma test coverage enabled, the started java VM outputs this message (to stdout). -
Constructor Summary
ConstructorsConstructorDescriptionProcessExecutorClient(org.apache.commons.configuration.Configuration conf, RMIRegistryService rmiReg, ProcessContextRegistry contextReg, String tenantName) constructs a new client, starts theProcessExecutorServerand connects to it. -
Method Summary
Modifier and TypeMethodDescriptionintexecute(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 Details
-
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 Details
-
ProcessExecutorClient
public ProcessExecutorClient(org.apache.commons.configuration.Configuration conf, RMIRegistryService rmiReg, ProcessContextRegistry contextReg, String tenantName) throws IOException, NotBoundException constructs 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:
IOException- if the sub process could not be spawned correctly or the any other communication error occurred.NotBoundException- if the server was not correctly bound to the rmi registry
-
-
Method Details
-
quit
Description 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:
IOException- on any error
-
execute
Description copied from interface:ProcessExecutorSynchronously executes the givenProcessContext.- Parameters:
ctx- the context to execute- Returns:
- the exit code of the underlying os process.
- Throws:
IOException- on eny error while executing the process.
-