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
TheJob
implements tasks, whose execution can be scheduled and which can be executed both synchronous and asynchronous (by running in a separatedThread
). TheJob
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 theCronJob
instance, which is passed to theJob
when it is started. Apart from the normal execution of the task theJob
implements, aJob
can support the undo-mechanism, which allows to undo all changes, which have been performed by the previous execution of theJob
and the specifiedCronJob
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Job.JobFileLogContainer
static class
Job.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.String
CTX_CURRENTCRONJOB
Name of theSessionContext
attribute which contains theCronJob
instance.static java.lang.String
CTX_CURRENTJOB
Name of theSessionContext
attribute 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 boolean
canPerform(CronJob cronJob)
Deprecated.since ages - no available counterpart in servicelayerprotected boolean
canUndo(CronJob cronJob)
Deprecated.since ages - no counterpart in servicelayer availableprotected void
checkRemovable(SessionContext ctx)
Checks whether or not this it may be removed or not.protected void
configureCronjob(CronJob cronjob)
Deprecated.since ages - useCronJobFactory
mechanism instead, refer to appropriate wiki documentprotected Item
createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)
Has to be implemented for each concrete subtype of item.protected CronJobLogListener.CronJobLogContext
createLogContext(CronJob cronjob)
void
debug(java.lang.String message)
Deprecated.since agesvoid
error(java.lang.String message)
Deprecated.since agesvoid
fatal(java.lang.String message)
Deprecated.since agesprotected java.util.Map<java.lang.String,java.lang.String>
getConfigAttributes(CronJob cronjob)
Deprecated.since ages - useCronJobFactory
mechanism 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.JobFileLogContainer
getCurrentLogContainer()
protected org.apache.log4j.Level
getEffectiveLogLevel(CronJob cronjob)
protected Item.ItemAttributeMap
getNonInitialAttributes(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'.void
info(java.lang.String message)
Deprecated.since agesboolean
isAbortable(CronJob conJob)
Deprecated.since ages - useCronJobService.isAbortable(de.hybris.platform.cronjob.model.CronJobModel)
insteadboolean
isDebugEnabled()
Deprecated.since agesboolean
isEnabledFor(org.apache.log4j.Level level)
Deprecated.since agesboolean
isErrorEnabled()
Deprecated.since agesboolean
isInfoEnabled()
Deprecated.since agesboolean
isPerformable(CronJob cronJob)
Deprecated.since ages - useCronJobService.isPerformable(de.hybris.platform.cronjob.model.CronJobModel)
insteadboolean
isPerformable(CronJob cronJob, int clusternode)
Deprecated.since ages - useCronJobService.isPerformable(de.hybris.platform.cronjob.model.CronJobModel)
insteadboolean
isUndoable(CronJob cronJob)
Deprecated.since ages - obsolete feature won't be supported in the futureboolean
isWarnEnabled()
Deprecated.since agesprotected static boolean
jobIsCurrentlyRunning()
void
log(java.lang.String message, org.apache.log4j.Level level)
protected void
logToFile(java.lang.String message, org.apache.log4j.Level level)
Proxy method to write cronjob logs to file too.void
perform(CronJob cronJob)
Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel)
insteadvoid
perform(CronJob cronJob, boolean synchronous)
Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)
insteadvoid
perform(CronJob cronJob, Job.Synchronicity synchronousType)
Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)
insteadprotected abstract CronJob.CronJobResult
performCronJob(CronJob cronJob)
Deprecated.since ages - useCronJobService.performCronJob(de.hybris.platform.cronjob.model.CronJobModel, boolean)
insteadprotected AfterCronJobFinishedEvent
prepareAfterFinishEvent(CronJob cj, boolean synchronous)
protected BeforeCronJobStartEvent
prepareBeforeStartEvent(CronJob cj, boolean synchronous)
void
remove(SessionContext ctx)
First all assignedCronJobs
were removed, than theJob
itself.protected static void
saveToLogFile(Job.JobFileLogContainer container, CronJob cronJob)
protected void
sendFinishedEvent(AfterCronJobFinishedEvent event, CronJob.CronJobResult result)
protected void
sendStartEvent(BeforeCronJobStartEvent event)
void
setCode(SessionContext ctx, java.lang.String code)
Generated method - Setter of theJob.code
attribute.void
setCronJobs(SessionContext ctx, java.util.Collection<CronJob> cronJobs)
Deprecated.since ages - not supported anymoreprotected static void
setCurrentLogContainer(Job.JobFileLogContainer logContainer)
void
setNonInitialAttributes(SessionContext ctx, Item item, Item.ItemAttributeMap nonInitialAttributes)
Sets all attributes which could not be set duringItem.createItem(SessionContext, ComposedType, ItemAttributeMap)
.protected JaloSession
startOwnSession(CronJob cronJob)
Activates a own session for executing the job.protected void
stopOwnSession(JaloSession previousSession, CronJob cronJob)
Deactivates the own session and re-activates the previous session if available.protected void
switchDataSource(CronJob cronjob)
void
undo(CronJob cronJob)
Deprecated.since ages - obsolete feature won't be supported in the futurevoid
undo(CronJob cronJob, boolean synchronous)
Deprecated.since ages - obsolete feature won't be supported in the futureprotected CronJob.CronJobResult
undoCronJob(CronJob cronJob)
Deprecated.this feature is not available since 4.3protected void
unsetAlternativeDataSource()
protected static void
unsetCurrentLogContainer()
void
warn(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 theSessionContext
attribute which contains the Job instance.- See Also:
- Constant Field Values
-
CTX_CURRENTCRONJOB
public static final java.lang.String CTX_CURRENTCRONJOB
Name of theSessionContext
attribute which contains theCronJob
instance.- See Also:
- Constant Field Values
-
-
Method Detail
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
Description copied from class:Item
Has 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:
createItem
in 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:Item
Sets 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:
setNonInitialAttributes
in 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:GenericItem
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'.- Overrides:
getNonInitialAttributes
in classGenericItem
- Parameters:
ctx
- session context with language = NULLallAttributes
- aItemAttributeMap
contaning attribute values.- Returns:
- a
ItemAttributeMap
containing all attribute values, which belong to non-initial attributes.
-
remove
public void remove(SessionContext ctx) throws ConsistencyCheckException
First all assignedCronJobs
were removed, than theJob
itself.- Overrides:
remove
in 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:Item
Checks whether or not this it may be removed or not. Called before the actual removal process.- Overrides:
checkRemovable
in 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 specifiedCollection
of CronJobs to this Job. All CronJobs, which where assigned to theJob
before and which are not part of the specifiedCollection
will be deleted.- Parameters:
ctx
- TheSessionContext
, which will be usedcronJobs
- theCollection
of 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 specifiedCronJob
can be undone. Overwrite this method of you want to undo your CronJob. Default value isfalse
- Parameters:
cronJob
- the CronJob to undo changes for- Returns:
true
if thisJob
is undoable,false
otherwise.
-
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:
true
if 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
- theCronJob
to undo- Returns:
- whether this
CronJob
is undoable or not
-
canPerform
@Deprecated protected boolean canPerform(CronJob cronJob)
Deprecated.since ages - no available counterpart in servicelayerThis method is called before aJob
is 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:
true
if thisJob
is performable,false
otherwise. 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 returntrue
Returnstrue
, if thisJob
can be performed using the specifiedCronjob
. Otherwisefalse
is returned.- Parameters:
cronJob
- which should be performed- Returns:
true
, if thisJob
can be performed using the specifiedCronjob
. Otherwisefalse
is 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 thisJob
asynchronous in a separateThread
using 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 thisJob
using the specifiedCronjob
. If synchronous istrue
, theJob
will be performed synchronous, which means that this method will return the control to its caller as recently as thisJob
is performed. Synchronous execution is especially useful for short Jobs or testing purpose (JUnit tests for example). If synchronous isfalse
, theJob
will be performed asynchronous by executing theJob
in a separateThread
.- Parameters:
cronJob
- which will be used to perform thisJob
synchronous
-true
if thisJob
should be performed synchronously,false
if thisJob
should 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 thisJob
asynchronous in a separateThread
using 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 thisJob
using the specifiedCronjob
. If synchronous istrue
, theJob
will be undone synchronous, which means that this method will return the control to its caller as recently as thisJob
is undone. Synchronous undo is especially useful for short Jobs or testing purpose (JUnit tests for example). If synchronous isfalse
, theJob
will be undone asynchronous by executing it in a separateThread
.- Parameters:
cronJob
- which will ne used to undo thisJob
synchronous
-true
if thisJob
should be undone synchronously,false
if thisJob
should 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 aCronJobResult
that indicates whether theJob
was successfully executed or not.- Parameters:
cronJob
- the CronJob to execute- Returns:
- a
CronJobResult
that indicates whether theJob
was 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
CronJobResult
that indicates whether the undo of yourJob
was 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:GeneratedJob
Generated method - Setter of theJob.code
attribute.- Overrides:
setCode
in classGeneratedJob
code
- the code- Since:
- 2.10
-
configureCronjob
@Deprecated protected void configureCronjob(CronJob cronjob) throws JaloInvalidParameterException, JaloBusinessException
Deprecated.since ages - useCronJobFactory
mechanism instead, refer to appropriate wiki document
-
getConfigAttributes
@Deprecated protected java.util.Map<java.lang.String,java.lang.String> getConfigAttributes(CronJob cronjob)
Deprecated.since ages - useCronJobFactory
mechanism instead, refer to appropriate wiki document
-
createLogContext
protected CronJobLogListener.CronJobLogContext createLogContext(CronJob cronjob)
-
getEffectiveLogLevel
protected org.apache.log4j.Level getEffectiveLogLevel(CronJob cronjob)
-
-