Package de.hybris.platform.cronjob.jalo
Class Job
- All Implemented Interfaces:
Serializable,Comparable
- Direct Known Subclasses:
CronJobHistoryJobExceptionTest.ExceptionJob,CustomAttributesTriggerableJob,GeneratedBatchJob,GeneratedCompareCatalogVersionsJob,GeneratedCompositeJob,GeneratedImpExExportJob,GeneratedImpExImportJob,GeneratedLDIFGroupImportJob,GeneratedLDIFImportJob,GeneratedMoveMediaJob,GeneratedRemoveCatalogVersionJob,GeneratedRemoveItemsJob,GeneratedRemoveOrphanedFilesJob,GeneratedServicelayerJob,GeneratedSyncItemJob,GeneratedTypeSystemExportJob,GeneratedWorkflowTemplate,SyncExcutionTestJob,TestJob,TriggerableTwoSecondJob
The
Job implements tasks, whose execution can be scheduled and which can be executed both synchronous
and asynchronous (by running in a separated Thread). The Job just implements all the logic
of the task it implements, it stores no "runtime" information. The runtime information (for example session
parameters (user, language, currency), import source file, or execution result) are stored in the
CronJob instance, which is passed to the Job when it is started.
Apart from the normal execution of the task the Job implements, a Job can support the
undo-mechanism, which allows to undo all changes, which have been performed by the previous execution of the
Job and the specified CronJob.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic enumNested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of theSessionContextattribute which contains theCronJobinstance.static final StringName of theSessionContextattribute which contains the Job instance.Fields inherited from class de.hybris.platform.cronjob.jalo.GeneratedJob
ACTIVE, ALTERNATIVEDATASOURCEID, CHANGERECORDINGENABLED, CODE, CRONJOBS, CRONJOBSHANDLER, DEFAULT_INITIAL_ATTRIBUTES, EMAILADDRESS, EMAILNOTIFICATIONTEMPLATE, ERRORMODE, LOGLEVELDATABASE, LOGLEVELFILE, LOGTODATABASE, LOGTOFILE, NODEGROUP, NODEID, NUMBEROFRETRIES, PRIORITY, REMOVEONEXIT, REQUESTABORT, REQUESTABORTSTEP, RESTRICTIONS, RESTRICTIONSHANDLER, RETRY, SENDEMAIL, SESSIONCONTEXTVALUES, SESSIONCURRENCY, SESSIONLANGUAGE, SESSIONUSER, SINGLEEXECUTABLE, TRIGGERS, TRIGGERSHANDLER, USEREADONLYDATASOURCEFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanPerform(CronJob cronJob) Deprecated.since ages - no available counterpart in servicelayerprotected booleanDeprecated.since ages - no counterpart in servicelayer availableprotected voidChecks whether or not this it may be removed or not.protected voidconfigureCronjob(CronJob cronjob) Deprecated.since ages - useCronJobFactorymechanism instead, refer to appropriate wiki documentprotected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) Has to be implemented for each concrete subtype of item.protected CronJobLogListener.CronJobLogContextcreateLogContext(CronJob cronjob) voidDeprecated.since agesvoidDeprecated.since agesvoidDeprecated.since agesgetConfigAttributes(CronJob cronjob) Deprecated.since ages - useCronJobFactorymechanism instead, refer to appropriate wiki documentgetCronJobsByCode(SessionContext ctx, String code) Deprecated.since ages - useCronJobService.getCronJob(String)insteadgetCronJobsByCode(String code) Deprecated.since ages - useCronJobService.getCronJob(String)insteadprotected static final Job.JobFileLogContainerprotected org.apache.log4j.LevelgetEffectiveLogLevel(CronJob cronjob) protected Item.ItemAttributeMapgetNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes) The default implementation ofGenericItem.getNonInitialAttributes(SessionContext, Item.ItemAttributeMap)assures that the 'registered initial' propertiesGenericItem.getInitialProperties(JaloSession, Item.ItemAttributeMap)will be removed from the 'non initial map'.voidDeprecated.since agesbooleanisAbortable(CronJob conJob) Deprecated.since ages - useCronJobService.isAbortable(de.hybris.platform.cronjob.model.CronJobModel)insteadbooleanDeprecated.since agesbooleanisEnabledFor(org.apache.log4j.Level level) Deprecated.since agesbooleanDeprecated.since agesbooleanDeprecated.since agesbooleanisPerformable(CronJob cronJob) Deprecated.since ages - useCronJobService.isPerformable(de.hybris.platform.cronjob.model.CronJobModel)insteadbooleanisPerformable(CronJob cronJob, int clusternode) Deprecated.since ages - useCronJobService.isPerformable(de.hybris.platform.cronjob.model.CronJobModel)insteadbooleanisUndoable(CronJob cronJob) Deprecated.since ages - obsolete feature won't be supported in the futurebooleanDeprecated.since agesprotected static final booleanvoidprotected voidProxy method to write cronjob logs to file too.final voidDeprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel)insteadfinal voidDeprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)insteadfinal voidperform(CronJob cronJob, Job.Synchronicity synchronousType) Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)insteadprotected abstract CronJob.CronJobResultperformCronJob(CronJob cronJob) Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)insteadprotected AfterCronJobFinishedEventprepareAfterFinishEvent(CronJob cj, boolean synchronous) protected BeforeCronJobStartEventprepareBeforeStartEvent(CronJob cj, boolean synchronous) voidremove(SessionContext ctx) First all assignedCronJobswere removed, than theJobitself.protected static final voidsaveToLogFile(Job.JobFileLogContainer container, CronJob cronJob) protected voidsendFinishedEvent(AfterCronJobFinishedEvent event, CronJob.CronJobResult result) protected voidvoidsetCode(SessionContext ctx, String code) Generated method - Setter of theJob.codeattribute.voidsetCronJobs(SessionContext ctx, Collection<CronJob> cronJobs) Deprecated.since ages - not supported anymoreprotected static final voidsetCurrentLogContainer(Job.JobFileLogContainer logContainer) voidsetNonInitialAttributes(SessionContext ctx, Item item, Item.ItemAttributeMap nonInitialAttributes) Sets all attributes which could not be set duringItem.createItem(SessionContext, ComposedType, ItemAttributeMap).protected JaloSessionstartOwnSession(CronJob cronJob) Activates a own session for executing the job.protected voidstopOwnSession(JaloSession previousSession, CronJob cronJob) Deactivates the own session and re-activates the previous session if available.protected voidswitchDataSource(CronJob cronjob) final voidDeprecated.since ages - obsolete feature won't be supported in the futurefinal voidDeprecated.since ages - obsolete feature won't be supported in the futureprotected CronJob.CronJobResultundoCronJob(CronJob cronJob) Deprecated.this feature is not available since 4.3protected voidprotected static final voidvoidDeprecated.since agesMethods inherited from class de.hybris.platform.cronjob.jalo.GeneratedJob
addToRestrictions, addToRestrictions, addToTriggers, addToTriggers, getAlternativeDataSourceID, getAlternativeDataSourceID, getCode, getCode, getCronJobs, getCronJobs, getDefaultAttributeModes, getEmailAddress, getEmailAddress, getEmailNotificationTemplate, getEmailNotificationTemplate, getErrorMode, getErrorMode, getLogLevelDatabase, getLogLevelDatabase, getLogLevelFile, getLogLevelFile, getNodeGroup, getNodeGroup, getNodeID, getNodeID, getNodeIDAsPrimitive, getNodeIDAsPrimitive, getNumberOfRetries, getNumberOfRetries, getNumberOfRetriesAsPrimitive, getNumberOfRetriesAsPrimitive, getPriority, getPriority, getPriorityAsPrimitive, getPriorityAsPrimitive, getRestrictions, getRestrictions, getSessionCurrency, getSessionCurrency, getSessionLanguage, getSessionLanguage, getSessionUser, getSessionUser, getTriggers, getTriggers, isActive, isActive, isActiveAsPrimitive, isActiveAsPrimitive, isChangeRecordingEnabled, isChangeRecordingEnabled, isChangeRecordingEnabledAsPrimitive, isChangeRecordingEnabledAsPrimitive, isLogToDatabase, isLogToDatabase, isLogToDatabaseAsPrimitive, isLogToDatabaseAsPrimitive, isLogToFile, isLogToFile, isLogToFileAsPrimitive, isLogToFileAsPrimitive, isRemoveOnExit, isRemoveOnExit, isRemoveOnExitAsPrimitive, isRemoveOnExitAsPrimitive, isRequestAbort, isRequestAbort, isRequestAbortAsPrimitive, isRequestAbortAsPrimitive, isRequestAbortStep, isRequestAbortStep, isRequestAbortStepAsPrimitive, isRequestAbortStepAsPrimitive, isRetry, isRetry, isRetryAsPrimitive, isRetryAsPrimitive, isSendEmail, isSendEmail, isSendEmailAsPrimitive, isSendEmailAsPrimitive, isSingleExecutable, isSingleExecutable, isSingleExecutableAsPrimitive, isSingleExecutableAsPrimitive, isUseReadOnlyDatasource, isUseReadOnlyDatasource, isUseReadOnlyDatasourceAsPrimitive, isUseReadOnlyDatasourceAsPrimitive, removeFromRestrictions, removeFromRestrictions, removeFromTriggers, removeFromTriggers, setActive, setActive, setActive, setActive, setAlternativeDataSourceID, setAlternativeDataSourceID, setChangeRecordingEnabled, setChangeRecordingEnabled, setChangeRecordingEnabled, setChangeRecordingEnabled, setCode, setEmailAddress, setEmailAddress, setEmailNotificationTemplate, setEmailNotificationTemplate, setErrorMode, setErrorMode, setLogLevelDatabase, setLogLevelDatabase, setLogLevelFile, setLogLevelFile, setLogToDatabase, setLogToDatabase, setLogToDatabase, setLogToDatabase, setLogToFile, setLogToFile, setLogToFile, setLogToFile, setNodeGroup, setNodeGroup, setNodeID, setNodeID, setNodeID, setNodeID, setNumberOfRetries, setNumberOfRetries, setNumberOfRetries, setNumberOfRetries, setPriority, setPriority, setPriority, setPriority, setRemoveOnExit, setRemoveOnExit, setRemoveOnExit, setRemoveOnExit, setRequestAbort, setRequestAbort, setRequestAbort, setRequestAbort, setRequestAbortStep, setRequestAbortStep, setRequestAbortStep, setRequestAbortStep, setRestrictions, setRestrictions, setRetry, setRetry, setRetry, setRetry, setSendEmail, setSendEmail, setSendEmail, setSendEmail, setSessionCurrency, setSessionCurrency, setSessionLanguage, setSessionLanguage, setSessionUser, setSessionUser, setSingleExecutable, setSingleExecutable, setSingleExecutable, setSingleExecutable, setTriggers, setTriggers, setUseReadOnlyDatasource, setUseReadOnlyDatasource, setUseReadOnlyDatasource, setUseReadOnlyDatasourceMethods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getRelatedItems, getRelatedItems, setRelatedItemsMethods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyMethods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPartOfRemovedSessionMarker, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setOwner, setPermissionsByMap, setTransientObject, setUseTA, suppressRelation, toString, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Field Details
-
CTX_CURRENTJOB
Name of theSessionContextattribute which contains the Job instance.- See Also:
-
CTX_CURRENTCRONJOB
Name of theSessionContextattribute which contains theCronJobinstance.- See Also:
-
-
Constructor Details
-
Job
public Job()
-
-
Method Details
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException Description copied from class:ItemHas to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) duringComposedType.newInstance(Map).In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap)too.
Sn example:public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) ); // here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes( SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret = super.getNonInitialAttributes( ctx, allAttributes ); // remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }- Overrides:
createItemin classGenericItem- Parameters:
ctx- the current session context which this item is created withintype- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException- indicates an error during creation - any changes will be rollbacked
-
setNonInitialAttributes
public void setNonInitialAttributes(SessionContext ctx, Item item, Item.ItemAttributeMap nonInitialAttributes) throws JaloBusinessException Description copied from class:ItemSets all attributes which could not be set duringItem.createItem(SessionContext, ComposedType, ItemAttributeMap). as default this method just iterates over all attribute mappings and sets the value by invokingItem.setAttribute(SessionContext, String, Object).- Overrides:
setNonInitialAttributesin classItem- Parameters:
ctx- session context with language = NULLitem- the newly created itemnonInitialAttributes- the non-initial attributed obtained viaItem.getNonInitialAttributes(SessionContext, ItemAttributeMap)- Throws:
JaloBusinessException
-
getNonInitialAttributes
protected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes) Description copied from class:GenericItemThe default implementation ofGenericItem.getNonInitialAttributes(SessionContext, Item.ItemAttributeMap)assures that the 'registered initial' propertiesGenericItem.getInitialProperties(JaloSession, Item.ItemAttributeMap)will be removed from the 'non initial map'.- Overrides:
getNonInitialAttributesin classGenericItem- Parameters:
ctx- session context with language = NULLallAttributes- aItemAttributeMapcontaning attribute values.- Returns:
- a
ItemAttributeMapcontaining all attribute values, which belong to non-initial attributes.
-
remove
First all assignedCronJobswere removed, than theJobitself.- Overrides:
removein classItem- Parameters:
ctx- A SessionContext object- Throws:
ConsistencyCheckException- if this item could not be removed for some reason- See Also:
-
checkRemovable
Description copied from class:ItemChecks whether or not this it may be removed or not. Called before the actual removal process.- Overrides:
checkRemovablein classItem- Throws:
ConsistencyCheckException- to indicate that the item cannot be removed
-
setCronJobs
@Deprecated(since="ages", forRemoval=false) public void setCronJobs(SessionContext ctx, Collection<CronJob> cronJobs) Deprecated.since ages - not supported anymoreAssigns the specifiedCollectionof CronJobs to this Job. All CronJobs, which where assigned to theJobbefore and which are not part of the specifiedCollectionwill be deleted.- Parameters:
ctx- TheSessionContext, which will be usedcronJobs- theCollectionof CronJobs, which will be assigned to the Job
-
getCronJobsByCode
@Deprecated(since="ages", forRemoval=false) public Collection<CronJob> getCronJobsByCode(String code) Deprecated.since ages - useCronJobService.getCronJob(String)insteadReturns all assigned CronJobs which match the specified code (The code of a Job is not necessarily unique!).- Parameters:
code- The code of the searched Cronjobs- Returns:
- all assigned CronJobs which match the specified code
-
getCronJobsByCode
@Deprecated(since="ages", forRemoval=false) public Collection<CronJob> getCronJobsByCode(SessionContext ctx, String code) Deprecated.since ages - useCronJobService.getCronJob(String)insteadReturns all assigned CronJobs which match the specified code (The code of a Job is not necessarily unique!).- Parameters:
ctx- TheSessionContext, which will be usedcode- The code of the searched Cronjobs- Returns:
- all assigned CronJobs which match the specified code
-
canUndo
Deprecated.since ages - no counterpart in servicelayer availableReturnstrue, if the specifiedCronJobcan be undone. Overwrite this method of you want to undo your CronJob. Default value isfalse- Parameters:
cronJob- the CronJob to undo changes for- Returns:
trueif thisJobis undoable,falseotherwise.
-
isAbortable
Deprecated.since ages - useCronJobService.isAbortable(de.hybris.platform.cronjob.model.CronJobModel)insteadTells whether this currently executed job is abortable. As default this method returns false. Override to implement abortable jobs.- Parameters:
conJob- the current execution of this job.- Returns:
trueif the cronjob is running and the job supports aborting viaGeneratedCronJob.setRequestAbort(boolean)
-
isUndoable
Deprecated.since ages - obsolete feature won't be supported in the futureTests whether the given CronJob instance can be undone.- Parameters:
cronJob- theCronJobto undo- Returns:
- whether this
CronJobis undoable or not
-
canPerform
Deprecated.since ages - no available counterpart in servicelayerThis method is called before aJobis performed. If you override this method you can check the things that are necessary for the performing of yourJob. Default value istrue.- Parameters:
cronJob- the actualCronJob- Returns:
trueif thisJobis performable,falseotherwise. de.hybris.platform.servicelayer.cronjob.CronJobService
-
isPerformable
Deprecated.since ages - useCronJobService.isPerformable(de.hybris.platform.cronjob.model.CronJobModel)insteadTests whether the given CronJob instance can be performed. Internal the methodscanPerform( final CronJob cronJob )and canPerformInternal( final CronJob cronJob ) are called. Only if both methods returningtrue, this method also returntrueReturnstrue, if thisJobcan be performed using the specifiedCronjob. Otherwisefalseis returned.- Parameters:
cronJob- which should be performed- Returns:
true, if thisJobcan be performed using the specifiedCronjob. Otherwisefalseis returned
-
isPerformable
@Deprecated(since="ages", forRemoval=false) public boolean isPerformable(CronJob cronJob, int clusternode) Deprecated.since ages - useCronJobService.isPerformable(de.hybris.platform.cronjob.model.CronJobModel)instead -
perform
Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel)insteadPerforms thisJobasynchronous in a separateThreadusing the specifiedCronjob.- Parameters:
cronJob- which is used to perform thisJob
-
perform
@Deprecated(since="ages", forRemoval=false) public final void perform(CronJob cronJob, boolean synchronous) Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)insteadPerforms thisJobusing the specifiedCronjob. If synchronous istrue, theJobwill be performed synchronous, which means that this method will return the control to its caller as recently as thisJobis performed. Synchronous execution is especially useful for short Jobs or testing purpose (JUnit tests for example). If synchronous isfalse, theJobwill be performed asynchronous by executing theJobin a separateThread.- Parameters:
cronJob- which will be used to perform thisJobsynchronous-trueif thisJobshould be performed synchronously,falseif thisJobshould be performed asynchronously
-
perform
@Deprecated(since="ages", forRemoval=false) public final void perform(CronJob cronJob, Job.Synchronicity synchronousType) Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)instead -
prepareBeforeStartEvent
-
sendStartEvent
-
prepareAfterFinishEvent
-
sendFinishedEvent
-
switchDataSource
-
unsetAlternativeDataSource
protected void unsetAlternativeDataSource() -
setCurrentLogContainer
-
unsetCurrentLogContainer
protected static final void unsetCurrentLogContainer() -
getCurrentLogContainer
-
jobIsCurrentlyRunning
protected static final boolean jobIsCurrentlyRunning() -
saveToLogFile
-
logToFile
Proxy method to write cronjob logs to file too. -
log
-
debug
Deprecated.since ages -
info
Deprecated.since ages -
warn
Deprecated.since ages -
error
Deprecated.since ages -
fatal
Deprecated.since ages -
isEnabledFor
@Deprecated(since="ages", forRemoval=false) public boolean isEnabledFor(org.apache.log4j.Level level) Deprecated.since ages -
isDebugEnabled
Deprecated.since ages -
isInfoEnabled
Deprecated.since ages -
isWarnEnabled
Deprecated.since ages -
isErrorEnabled
Deprecated.since ages -
undo
Deprecated.since ages - obsolete feature won't be supported in the futureUndos thisJobasynchronous in a separateThreadusing the specifiedCronjob.- Parameters:
cronJob- which is used to perform thisJob
-
undo
@Deprecated(since="ages", forRemoval=false) public final void undo(CronJob cronJob, boolean synchronous) Deprecated.since ages - obsolete feature won't be supported in the futureUndos thisJobusing the specifiedCronjob. If synchronous istrue, theJobwill be undone synchronous, which means that this method will return the control to its caller as recently as thisJobis undone. Synchronous undo is especially useful for short Jobs or testing purpose (JUnit tests for example). If synchronous isfalse, theJobwill be undone asynchronous by executing it in a separateThread.- Parameters:
cronJob- which will ne used to undo thisJobsynchronous-trueif thisJobshould be undone synchronously,falseif thisJobshould be undone asynchronously
-
performCronJob
@Deprecated(since="ages", forRemoval=false) protected abstract CronJob.CronJobResult performCronJob(CronJob cronJob) throws AbortCronJobException Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)insteadYou have to implement this method in yourJob. Here you can execute the job. You have to return aCronJobResultthat indicates whether theJobwas successfully executed or not.- Parameters:
cronJob- the CronJob to execute- Returns:
- a
CronJobResultthat indicates whether theJobwas successfully executed or not. - Throws:
AbortCronJobException- See Also:
-
undoCronJob
@Deprecated(since="ages", forRemoval=false) protected CronJob.CronJobResult undoCronJob(CronJob cronJob) Deprecated.this feature is not available since 4.3Overwrite this method to undo changes made in your job. This method is called, if you decide to undo your job.- Parameters:
cronJob- the CronJob to undo- Returns:
- a
CronJobResultthat indicates whether the undo of yourJobwas successful or not
-
startOwnSession
Activates a own session for executing the job. The current session is returned so it may be continued after execution.- Returns:
- the current session or null if no current session is set
- Throws:
ConsistencyCheckException
-
stopOwnSession
Deactivates the own session and re-activates the previous session if available.- Parameters:
previousSession-cronJob-
-
setCode
Description copied from class:GeneratedJobGenerated method - Setter of theJob.codeattribute.- Overrides:
setCodein classGeneratedJobcode- the code- Since:
- 2.10
-
configureCronjob
@Deprecated(since="ages", forRemoval=false) protected void configureCronjob(CronJob cronjob) throws JaloInvalidParameterException, JaloBusinessException Deprecated.since ages - useCronJobFactorymechanism instead, refer to appropriate wiki document -
getConfigAttributes
@Deprecated(since="ages", forRemoval=false) protected Map<String,String> getConfigAttributes(CronJob cronjob) Deprecated.since ages - useCronJobFactorymechanism instead, refer to appropriate wiki document -
createLogContext
-
getEffectiveLogLevel
-