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 ofJobPerformablefor rule engine tasks
-
-
Field Summary
Fields Modifier and Type Field Description protected static PerformResultABORTED_RESULTprotected static PerformResultFAILURE_RESULTprotected static PerformResultSUCCESS_RESULT-
Fields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService
-
-
Constructor Summary
Constructors Constructor Description AbstractRuleEngineJob()
-
Method Summary
-
Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isPerformable, setFlexibleSearchService, setModelService, setSessionService
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.servicelayer.cronjob.JobPerformable
isPerformable
-
-
-
-
Field Detail
-
SUCCESS_RESULT
protected static final PerformResult SUCCESS_RESULT
-
FAILURE_RESULT
protected static final PerformResult FAILURE_RESULT
-
ABORTED_RESULT
protected static final PerformResult ABORTED_RESULT
-
-
Method Detail
-
perform
public PerformResult perform(RuleEngineCronJobModel cronJob)
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
public boolean isPerformable(RuleEngineCronJobModel cronJob)
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 java.util.Optional<RuleCompilerPublisherResult> performInternal(RuleEngineCronJobModel cronJob, CronJobProgressTracker tracker)
-
createCronJobProgressTracker
protected CronJobProgressTracker createCronJobProgressTracker(RuleEngineCronJobModel cronJob)
-
getJobName
protected abstract java.lang.String getJobName()
-
getPerformResult
protected PerformResult getPerformResult(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult result)
-
hasErrors
protected boolean hasErrors(RuleCompilerPublisherResult result)
-
hasPublisherErrors
protected boolean hasPublisherErrors(RuleCompilerPublisherResult result)
-
onError
protected void onError(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults)
-
logCompilerErrorMessages
protected void logCompilerErrorMessages(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults)
-
logPublisherErrorMessages
protected void logPublisherErrorMessages(RuleEngineCronJobModel cronJob, RuleCompilerPublisherResult ruleResults)
-
logToDatabase
protected void logToDatabase(RuleEngineCronJobModel cronJob, java.lang.String error)
-
logOnJobStart
protected void logOnJobStart()
-
logOnSuccessfulJobFinish
protected void logOnSuccessfulJobFinish()
-
logOnFailedJobFinish
protected void logOnFailedJobFinish()
-
setTrackerProgress
protected void setTrackerProgress(CronJobProgressTracker tracker, double progress)
-
getRuleMaintenanceService
protected RuleMaintenanceService getRuleMaintenanceService()
-
setRuleMaintenanceService
public void setRuleMaintenanceService(RuleMaintenanceService ruleMaintenanceService)
-
getRuleEngineJobExecutionSynchronizer
protected RuleEngineJobExecutionSynchronizer getRuleEngineJobExecutionSynchronizer()
-
setRuleEngineJobExecutionSynchronizer
public void setRuleEngineJobExecutionSynchronizer(RuleEngineJobExecutionSynchronizer ruleEngineJobExecutionSynchronizer)
-
getModelService
protected ModelService getModelService()
-
-