Package de.hybris.platform.cronjob.jalo
Class Job
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
- Direct Known Subclasses:
CustomAttributesTriggerableJob,GeneratedBatchJob,GeneratedCompareCatalogVersionsJob,GeneratedCompositeJob,GeneratedImpExExportJob,GeneratedImpExImportJob,GeneratedLDIFGroupImportJob,GeneratedLDIFImportJob,GeneratedMoveMediaJob,GeneratedRemoveCatalogVersionJob,GeneratedRemoveItemsJob,GeneratedRemoveOrphanedFilesJob,GeneratedServicelayerJob,GeneratedSyncItemJob,GeneratedTypeSystemExportJob,GeneratedWorkflowTemplate,SyncExcutionTestJob,TestJob,TriggerableTwoSecondJob
public abstract class Job extends GeneratedJob
TheJobimplements tasks, whose execution can be scheduled and which can be executed both synchronous and asynchronous (by running in a separatedThread). TheJobjust 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 theCronJobinstance, which is passed to theJobwhen it is started. Apart from the normal execution of the task theJobimplements, aJobcan support the undo-mechanism, which allows to undo all changes, which have been performed by the previous execution of theJoband the specifiedCronJob.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classJob.JobFileLogContainerstatic classJob.Synchronicity-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
Nested 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
Fields Modifier and Type Field Description static java.lang.StringCTX_CURRENTCRONJOBName of theSessionContextattribute which contains theCronJobinstance.static java.lang.StringCTX_CURRENTJOBName 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, PRIORITY, REMOVEONEXIT, REQUESTABORT, REQUESTABORTSTEP, RESTRICTIONS, RESTRICTIONSHANDLER, RETRY, SENDEMAIL, SESSIONCONTEXTVALUES, SESSIONCURRENCY, SESSIONLANGUAGE, SESSIONUSER, SINGLEEXECUTABLE, TRIGGERS, TRIGGERSHANDLER
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
Fields 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, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description Job()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleancanPerform(CronJob cronJob)Deprecated.since ages - no available counterpart in servicelayerprotected booleancanUndo(CronJob cronJob)Deprecated.since ages - no counterpart in servicelayer availableprotected voidcheckRemovable(SessionContext ctx)Checks 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)voiddebug(java.lang.String message)Deprecated.since agesvoiderror(java.lang.String message)Deprecated.since agesvoidfatal(java.lang.String message)Deprecated.since agesprotected java.util.Map<java.lang.String,java.lang.String>getConfigAttributes(CronJob cronjob)Deprecated.since ages - useCronJobFactorymechanism instead, refer to appropriate wiki documentjava.util.Collection<CronJob>getCronJobsByCode(SessionContext ctx, java.lang.String code)Deprecated.since ages - useCronJobService.getCronJob(String)insteadjava.util.Collection<CronJob>getCronJobsByCode(java.lang.String code)Deprecated.since ages - useCronJobService.getCronJob(String)insteadprotected static Job.JobFileLogContainergetCurrentLogContainer()protected 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'.voidinfo(java.lang.String message)Deprecated.since agesbooleanisAbortable(CronJob conJob)Deprecated.since ages - useCronJobService.isAbortable(de.hybris.platform.cronjob.model.CronJobModel)insteadbooleanisDebugEnabled()Deprecated.since agesbooleanisEnabledFor(org.apache.log4j.Level level)Deprecated.since agesbooleanisErrorEnabled()Deprecated.since agesbooleanisInfoEnabled()Deprecated.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 futurebooleanisWarnEnabled()Deprecated.since agesprotected static booleanjobIsCurrentlyRunning()voidlog(java.lang.String message, org.apache.log4j.Level level)protected voidlogToFile(java.lang.String message, org.apache.log4j.Level level)Proxy method to write cronjob logs to file too.voidperform(CronJob cronJob)Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel)insteadvoidperform(CronJob cronJob, boolean synchronous)Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)insteadvoidperform(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 voidsaveToLogFile(Job.JobFileLogContainer container, CronJob cronJob)protected voidsendFinishedEvent(AfterCronJobFinishedEvent event, CronJob.CronJobResult result)protected voidsendStartEvent(BeforeCronJobStartEvent event)voidsetCode(SessionContext ctx, java.lang.String code)Generated method - Setter of theJob.codeattribute.voidsetCronJobs(SessionContext ctx, java.util.Collection<CronJob> cronJobs)Deprecated.since ages - not supported anymoreprotected static 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)voidundo(CronJob cronJob)Deprecated.since ages - obsolete feature won't be supported in the futurevoidundo(CronJob cronJob, boolean synchronous)Deprecated.since ages - obsolete feature won't be supported in the futureprotected CronJob.CronJobResultundoCronJob(CronJob cronJob)Deprecated.this feature is not available since 4.3protected voidunsetAlternativeDataSource()protected static voidunsetCurrentLogContainer()voidwarn(java.lang.String message)Deprecated.since ages-
Methods 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, 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, 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, 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
-
Methods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getRelatedItems, setRelatedItems
-
Methods 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, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setProperty
-
Methods 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, 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, toString, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
CTX_CURRENTJOB
public static final java.lang.String CTX_CURRENTJOB
Name of theSessionContextattribute which contains the Job instance.- See Also:
- Constant Field Values
-
CTX_CURRENTCRONJOB
public static final java.lang.String CTX_CURRENTCRONJOB
Name of theSessionContextattribute which contains theCronJobinstance.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public void remove(SessionContext ctx) throws ConsistencyCheckException
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:
Item.remove(de.hybris.platform.jalo.SessionContext)
-
checkRemovable
protected void checkRemovable(SessionContext ctx) throws ConsistencyCheckException
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 public void setCronJobs(SessionContext ctx, java.util.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 public java.util.Collection<CronJob> getCronJobsByCode(java.lang.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 public java.util.Collection<CronJob> getCronJobsByCode(SessionContext ctx, java.lang.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 protected boolean canUndo(CronJob cronJob)
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 public boolean isAbortable(CronJob conJob)
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 public boolean isUndoable(CronJob cronJob)
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 protected boolean canPerform(CronJob cronJob)
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 public boolean isPerformable(CronJob cronJob)
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 public boolean isPerformable(CronJob cronJob, int clusternode)
Deprecated.since ages - useCronJobService.isPerformable(de.hybris.platform.cronjob.model.CronJobModel)instead
-
perform
@Deprecated public final void perform(CronJob cronJob)
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 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 public final void perform(CronJob cronJob, Job.Synchronicity synchronousType)
Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)instead
-
prepareBeforeStartEvent
protected BeforeCronJobStartEvent prepareBeforeStartEvent(CronJob cj, boolean synchronous)
-
sendStartEvent
protected void sendStartEvent(BeforeCronJobStartEvent event)
-
prepareAfterFinishEvent
protected AfterCronJobFinishedEvent prepareAfterFinishEvent(CronJob cj, boolean synchronous)
-
sendFinishedEvent
protected void sendFinishedEvent(AfterCronJobFinishedEvent event, CronJob.CronJobResult result)
-
switchDataSource
protected void switchDataSource(CronJob cronjob)
-
unsetAlternativeDataSource
protected void unsetAlternativeDataSource()
-
setCurrentLogContainer
protected static final void setCurrentLogContainer(Job.JobFileLogContainer logContainer)
-
unsetCurrentLogContainer
protected static final void unsetCurrentLogContainer()
-
getCurrentLogContainer
protected static final Job.JobFileLogContainer getCurrentLogContainer()
-
jobIsCurrentlyRunning
protected static final boolean jobIsCurrentlyRunning()
-
saveToLogFile
protected static final void saveToLogFile(Job.JobFileLogContainer container, CronJob cronJob)
-
logToFile
protected void logToFile(java.lang.String message, org.apache.log4j.Level level)Proxy method to write cronjob logs to file too.
-
log
public void log(java.lang.String message, org.apache.log4j.Level level)
-
debug
@Deprecated public void debug(java.lang.String message)
Deprecated.since ages
-
info
@Deprecated public void info(java.lang.String message)
Deprecated.since ages
-
warn
@Deprecated public void warn(java.lang.String message)
Deprecated.since ages
-
error
@Deprecated public void error(java.lang.String message)
Deprecated.since ages
-
fatal
@Deprecated public void fatal(java.lang.String message)
Deprecated.since ages
-
isEnabledFor
@Deprecated public boolean isEnabledFor(org.apache.log4j.Level level)
Deprecated.since ages
-
isDebugEnabled
@Deprecated public boolean isDebugEnabled()
Deprecated.since ages
-
isInfoEnabled
@Deprecated public boolean isInfoEnabled()
Deprecated.since ages
-
isWarnEnabled
@Deprecated public boolean isWarnEnabled()
Deprecated.since ages
-
isErrorEnabled
@Deprecated public boolean isErrorEnabled()
Deprecated.since ages
-
undo
@Deprecated public final void undo(CronJob cronJob)
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 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 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:
CronJob.getFinishedResult(boolean),CronJob.getAbortResult()
-
undoCronJob
@Deprecated 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
protected JaloSession startOwnSession(CronJob cronJob) throws ConsistencyCheckException
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
protected void stopOwnSession(JaloSession previousSession, CronJob cronJob)
Deactivates the own session and re-activates the previous session if available.- Parameters:
previousSession-cronJob-
-
setCode
public void setCode(SessionContext ctx, java.lang.String code)
Description copied from class:GeneratedJobGenerated method - Setter of theJob.codeattribute.- Overrides:
setCodein classGeneratedJobcode- the code- Since:
- 2.10
-
configureCronjob
@Deprecated protected void configureCronjob(CronJob cronjob) throws JaloInvalidParameterException, JaloBusinessException
Deprecated.since ages - useCronJobFactorymechanism instead, refer to appropriate wiki document
-
getConfigAttributes
@Deprecated protected java.util.Map<java.lang.String,java.lang.String> getConfigAttributes(CronJob cronjob)
Deprecated.since ages - useCronJobFactorymechanism instead, refer to appropriate wiki document
-
createLogContext
protected CronJobLogListener.CronJobLogContext createLogContext(CronJob cronjob)
-
getEffectiveLogLevel
protected org.apache.log4j.Level getEffectiveLogLevel(CronJob cronjob)
-
-