public class FolderBasedScriptJobResolver extends Object implements ScriptJobResolver, org.springframework.web.context.ServletContextAware
ScriptJobResolver
, which resolves all scripts under a certain folder, and creates a trigger
to run them using a specific cron expression. For example, a resolver for the folder name daily can return scripts
that need to be run every day at 12:00 am.Modifier and Type | Field and Description |
---|---|
protected String |
cronExpression |
protected boolean |
disableVariableRestrictions |
protected String |
folderUrl |
protected String |
scriptSuffix |
protected javax.servlet.ServletContext |
servletContext |
Constructor and Description |
---|
FolderBasedScriptJobResolver() |
Modifier and Type | Method and Description |
---|---|
List<JobContext> |
resolveJobs(SiteContext siteContext)
Resolves any number of script jobs to be scheduled and executed.
|
void |
setCronExpression(String cronExpression) |
void |
setDisableVariableRestrictions(boolean disableVariableRestrictions) |
void |
setFolderUrl(String folderUrl) |
void |
setScriptSuffix(String scriptSuffix) |
void |
setServletContext(javax.servlet.ServletContext servletContext) |
protected String folderUrl
protected String cronExpression
protected String scriptSuffix
protected javax.servlet.ServletContext servletContext
protected boolean disableVariableRestrictions
public void setFolderUrl(String folderUrl)
public void setCronExpression(String cronExpression)
public void setScriptSuffix(String scriptSuffix)
public void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext
in interface org.springframework.web.context.ServletContextAware
public void setDisableVariableRestrictions(boolean disableVariableRestrictions)
public List<JobContext> resolveJobs(SiteContext siteContext) throws SchedulingException
ScriptJobResolver
resolveJobs
in interface ScriptJobResolver
siteContext
- the context used to look up for the scriptsSchedulingException
Copyright © 2022 CrafterCMS. All rights reserved.