Class DefaultRuleEngineTaskProcessor<I extends ItemModel>
java.lang.Object
de.hybris.platform.ruleengine.concurrency.impl.DefaultRuleEngineTaskProcessor<I>
- Type Parameters:
I- type ofItemModelin the list
- All Implemented Interfaces:
RuleEngineSpliteratorStrategy,RuleEngineTaskProcessor<I,TaskResult>
public class DefaultRuleEngineTaskProcessor<I extends ItemModel>
extends Object
implements RuleEngineTaskProcessor<I,TaskResult>, RuleEngineSpliteratorStrategy
Default implementation of
RuleEngineTaskProcessor-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ThreadProcess the items in the list in multi-thread mode with provided items consumerProcess the items in the list in multi-thread mode with provided items consumerintget the number of threads to be allocated for spliteratorprotected SuspendResumeTaskManagerprotected Tenantprotected ThreadFactoryvoidsetSuspendResumeTaskManager(SuspendResumeTaskManager suspendResumeTaskManager) voidvoidsetTenantAwareThreadFactory(ThreadFactory tenantAwareThreadFactory)
-
Constructor Details
-
DefaultRuleEngineTaskProcessor
public DefaultRuleEngineTaskProcessor()
-
-
Method Details
-
execute
Description copied from interface:RuleEngineTaskProcessorProcess the items in the list in multi-thread mode with provided items consumer- Specified by:
executein interfaceRuleEngineTaskProcessor<I extends ItemModel,TaskResult> - Parameters:
items- the list of items to processtaskConsumer- instance ofConsumerencapsulating the processing logic- Returns:
- The
TaskExecutionFutureof the execution process
-
execute
public TaskExecutionFuture<TaskResult> execute(List<I> items, Consumer<List<I>> taskConsumer, long predestroyTimeout) Description copied from interface:RuleEngineTaskProcessorProcess the items in the list in multi-thread mode with provided items consumer- Specified by:
executein interfaceRuleEngineTaskProcessor<I extends ItemModel,TaskResult> - Parameters:
items- the list of items to processtaskConsumer- instance ofConsumerencapsulating the processing logicpredestroyTimeout- time in milliseconds to wait until forcing the thread join (to prevent eventual thread blocking)- Returns:
- The
TaskExecutionFutureof the execution process
-
getNumberOfThreads
public int getNumberOfThreads()Description copied from interface:RuleEngineSpliteratorStrategyget the number of threads to be allocated for spliterator- Specified by:
getNumberOfThreadsin interfaceRuleEngineSpliteratorStrategy- Returns:
- number of threads to allocate
-
createAndStartNewWorker
-
getTenant
-
setTenant
-
getTenantAwareThreadFactory
-
setTenantAwareThreadFactory
-
getSuspendResumeTaskManager
-
setSuspendResumeTaskManager
-