Class AbstractRuleEngineJob
java.lang.Object
de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<RuleEngineCronJobModel>
de.hybris.platform.ruleengineservices.jobs.impl.AbstractRuleEngineJob
- All Implemented Interfaces:
RuleEngineJobPerformable<RuleEngineCronJobModel>,JobPerformable<RuleEngineCronJobModel>
- Direct Known Subclasses:
RuleEngineAllModulesInitJobPerformable,RuleEngineCompilePublishJobPerformable,RuleEngineModuleInitJobPerformable,RuleEngineModuleSyncJobPerformable,RuleEngineUndeployJobPerformable
public abstract class AbstractRuleEngineJob
extends AbstractJobPerformable<RuleEngineCronJobModel>
implements RuleEngineJobPerformable<RuleEngineCronJobModel>
Abstract implementation of
JobPerformable for rule engine tasks-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final PerformResultprotected static final PerformResultprotected static final PerformResultFields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CronJobProgressTrackerprotected abstract Stringprotected ModelServiceprotected PerformResultgetPerformResult(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult result) protected RuleEngineJobExecutionSynchronizerprotected RuleMaintenanceServiceprotected booleanhasErrors(RuleCompilerPublisherResult result) protected booleanbooleanChecks whether the execution is implemented abortable.booleanisPerformable(RuleEngineCronJobModel cronJob) Identifies whether provided cron job can be performedprotected voidlogCompilerErrorMessages(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults) protected voidprotected voidprotected voidprotected voidlogPublisherErrorMessages(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults) protected voidlogToDatabase(RuleEngineCronJobModel cronJob, String error) protected voidonError(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults) perform(RuleEngineCronJobModel cronJob) The execution body for aServicelayerJob.protected abstract Optional<RuleCompilerPublisherResult>performInternal(RuleEngineCronJobModel cronJob, CronJobProgressTracker tracker) voidsetRuleEngineJobExecutionSynchronizer(RuleEngineJobExecutionSynchronizer ruleEngineJobExecutionSynchronizer) voidsetRuleMaintenanceService(RuleMaintenanceService ruleMaintenanceService) protected voidsetTrackerProgress(CronJobProgressTracker tracker, double progress) Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isPerformable, setFlexibleSearchService, setModelService, setSessionServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.servicelayer.cronjob.JobPerformable
isPerformable
-
Field Details
-
SUCCESS_RESULT
-
FAILURE_RESULT
-
ABORTED_RESULT
-
-
Constructor Details
-
AbstractRuleEngineJob
public AbstractRuleEngineJob()
-
-
Method Details
-
perform
Description copied from interface:JobPerformableThe execution body for aServicelayerJob. Implement here your execution logic. It can be called synchronous or asynchronous. So be aware of thread-safety. Method will return a result object saying if the execution has reached end and if it was successful.- Specified by:
performin interfaceJobPerformable<RuleEngineCronJobModel>- Specified by:
performin classAbstractJobPerformable<RuleEngineCronJobModel>- Parameters:
cronJob- the related CronJob in whose context the execution will be performed.- Returns:
- a
PerformResultthat indicates whether theexecutionwas successfully executed or not and has finished or not.
-
isAbortable
public boolean isAbortable()Description copied from interface:JobPerformableChecks whether the execution is implemented abortable.- Specified by:
isAbortablein interfaceJobPerformable<RuleEngineCronJobModel>- Overrides:
isAbortablein classAbstractJobPerformable<RuleEngineCronJobModel>- Returns:
- true if the execution can be aborted
-
isPerformable
Description copied from interface:RuleEngineJobPerformableIdentifies whether provided cron job can be performed- Specified by:
isPerformablein interfaceRuleEngineJobPerformable<RuleEngineCronJobModel>- Parameters:
cronJob- - cron job instance- Returns:
truein case cron job can be performed,false- otherwise
-
performInternal
protected abstract Optional<RuleCompilerPublisherResult> performInternal(RuleEngineCronJobModel cronJob, CronJobProgressTracker tracker) -
createCronJobProgressTracker
-
getJobName
-
getPerformResult
protected PerformResult getPerformResult(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult result) -
hasErrors
-
hasPublisherErrors
-
onError
-
logCompilerErrorMessages
protected void logCompilerErrorMessages(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults) -
logPublisherErrorMessages
protected void logPublisherErrorMessages(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults) -
logToDatabase
-
logOnJobStart
protected void logOnJobStart() -
logOnSuccessfulJobFinish
protected void logOnSuccessfulJobFinish() -
logOnFailedJobFinish
protected void logOnFailedJobFinish() -
setTrackerProgress
-
getRuleMaintenanceService
-
setRuleMaintenanceService
-
getRuleEngineJobExecutionSynchronizer
-
setRuleEngineJobExecutionSynchronizer
public void setRuleEngineJobExecutionSynchronizer(RuleEngineJobExecutionSynchronizer ruleEngineJobExecutionSynchronizer) -
getModelService
-