Class LimitedProcessExecutor
java.lang.Object
de.hybris.platform.mediaconversion.os.process.AbstractProcessExecutor
de.hybris.platform.mediaconversion.os.process.impl.LimitedProcessExecutor
- All Implemented Interfaces:
ProcessExecutor
ProcessExecutor implementation wrapping another ProcessExecutor but limiting the amount of parallel
process to a given number.-
Constructor Summary
ConstructorsConstructorDescriptionLimitedProcessExecutor(int limit, ProcessExecutor executor) Creates a newLimitedProcessExecutordelegating all requests to the givenexecutorand limiting parallel processes to the specifiedlimit. -
Method Summary
Modifier and TypeMethodDescriptionintexecute(ProcessContext context) Delegates the execution request to the underlyingProcessExecutor, but blocking the currentThreadif the maximum number of parallel processes has already been reached.Accesses the delegate.voidquit()Terminates thisProcessExecutorand frees all associated resources.Methods inherited from class de.hybris.platform.mediaconversion.os.process.AbstractProcessExecutor
execute
-
Constructor Details
-
LimitedProcessExecutor
Creates a newLimitedProcessExecutordelegating all requests to the givenexecutorand limiting parallel processes to the specifiedlimit.- Parameters:
limit- the maximum number of parallel process to execute.executor- theProcessExecutorto delegate to.
-
-
Method Details
-
getExecutor
Accesses the delegate.- Returns:
- the
ProcessExecutorto delegate to.
-
execute
Delegates the execution request to the underlyingProcessExecutor, but blocking the currentThreadif the maximum number of parallel processes has already been reached.Synchronously executes the given
ProcessContext.- Parameters:
context- the context to execute- Returns:
- the exit code of the underlying os process.
- Throws:
IOException- on eny error while executing the process.- See Also:
-
quit
Terminates 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- See Also:
-