Class AbstractStaticSchedulable
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.impl.schedule.AbstractStaticSchedulable
- All Implemented Interfaces:
Schedulable
,LogEnabled
,PluginAware
,Component
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
AbstractCollectionSchedulable
,AbstractDeleteFilesSchedulable
,AbstractReportSchedulable
,AbstractSendingMailSchedulable
,ApogeeSchedulable
,CleanCacheSchedulable
,CleanJCaptchaSchedulable
,ComputeProgramSkillsSchedulable
,ContentExportSchedulable
,CoursePartPurgeSchedulable
,DeleteClassifiedAdsSchedulable
,ExportArchiveSchedulable
,ExportSchedulable
,GlobalValidationSchedulable
,ImportArchiveSchedulable
,InvalidateFOCacheSchedulable
,PublishOrUnpublishPageSchedulable
,ReindexMembersSchedulable
,ReloadSolrAclCacheSchedulable
,ReloadSolrAclCachesForCoresSchedulable
,ScriptSchedulable
,SendMailSchedulable
,SolrExportSchedulable
,SynchronizeAllCollectionsSchedulable
,UnlockSchedulable
public abstract class AbstractStaticSchedulable
extends AbstractLogEnabled
implements Schedulable, Component, Configurable, PluginAware, Serviceable, Contextualizable
Default static implementation of
For instance:
Schedulable
For implementing the Schedulable
interface (while being Configurable
), extends this class and implements the execute(org.quartz.JobExecutionContext)
method
For instance:
public class SayHelloSchedulable extends AbstractStaticSchedulable { public static final String FIRSTNAME_KEY = "firstName"; private static final String __JOBDATAMAP_FIRSTNAME_KEY = Scheduler.PARAM_VALUES_PREFIX + FIRSTNAME_KEY; public void execute(JobExecutionContext context) throws Exception { JobKey jobKey = context.getJobDetail().getKey(); JobDataMap jobDataMap = context.getJobDetail().getJobDataMap(); String name = jobDataMap.getString(__JOBDATAMAP_FIRSTNAME_KEY); System.out.println("[" + jobKey + "] " + new Date() + " - Hello " + name + "!"); } }
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
True if two runnables of this schedulable can be executed concurrentlyprotected Context
The contextprotected I18nizableText
The descriptionprotected String
The icon glyphprotected String
The large iconprotected String
The medium iconprotected String
The small iconprotected String
The id of this extensionprotected I18nizableText
The labelprotected Map<String,
ElementDefinition> The parametersprotected String
The name of the plugin that has declared this componentprotected boolean
True if the schedulable is privateprotected SchedulableParameterTypeExtensionPoint
The Schedulable Extension Pointprotected ServiceManager
The service managerprotected UserManager
The user manager -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if two runnables of this schedulable can be executed concurrentlyvoid
configure
(Configuration configuration) void
contextualize
(Context context) abstract void
execute
(JobExecutionContext context) The action to perform when a trigger is fired.Return the descriptionReturns the glyph iconReturns the path to the large icon in 48x48 pixelsReturns the path to the medium icon in 32x32 pixelsReturns the path to the small icon in 16x16 pixelsgetId()
Returns the idgetLabel()
Returns the labelGet the parameters for job executionboolean
Returns true if the schedulable is privatevoid
service
(ServiceManager manager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_pluginName
The name of the plugin that has declared this component -
_id
The id of this extension -
_smanager
The service manager -
_context
The context -
_label
The label -
_description
The description -
_iconGlyph
The icon glyph -
_iconSmall
The small icon -
_iconMedium
The medium icon -
_iconLarge
The large icon -
_private
True if the schedulable is private -
_acceptConcurrentExecution
True if two runnables of this schedulable can be executed concurrently -
_parameters
The parameters -
_schedulableParameterTypeExtensionPoint
The Schedulable Extension Point -
_userManager
The user manager
-
-
Constructor Details
-
AbstractStaticSchedulable
public AbstractStaticSchedulable()
-
-
Method Details
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
execute
Description copied from interface:Schedulable
The action to perform when a trigger is fired. Do not manually call this method.- Specified by:
execute
in interfaceSchedulable
- Parameters:
context
- the context- Throws:
Exception
- if an error occured
-
getId
Description copied from interface:Schedulable
Returns the id- Specified by:
getId
in interfaceSchedulable
- Returns:
- the id
-
getLabel
Description copied from interface:Schedulable
Returns the label- Specified by:
getLabel
in interfaceSchedulable
- Returns:
- the i18n label
-
getDescription
Description copied from interface:Schedulable
Return the description- Specified by:
getDescription
in interfaceSchedulable
- Returns:
- the i18n description
-
getIconGlyph
Description copied from interface:Schedulable
Returns the glyph icon- Specified by:
getIconGlyph
in interfaceSchedulable
- Returns:
- the glyph icon
-
getIconSmall
Description copied from interface:Schedulable
Returns the path to the small icon in 16x16 pixels- Specified by:
getIconSmall
in interfaceSchedulable
- Returns:
- the path to the 16x16 icon
-
getIconMedium
Description copied from interface:Schedulable
Returns the path to the medium icon in 32x32 pixels- Specified by:
getIconMedium
in interfaceSchedulable
- Returns:
- the path to the 32x32 icon
-
getIconLarge
Description copied from interface:Schedulable
Returns the path to the large icon in 48x48 pixels- Specified by:
getIconLarge
in interfaceSchedulable
- Returns:
- the path to the 48x48 icon
-
isPrivate
Description copied from interface:Schedulable
Returns true if the schedulable is private- Specified by:
isPrivate
in interfaceSchedulable
- Returns:
- true if the schedulable is private
-
acceptConcurrentExecution
Description copied from interface:Schedulable
Returns true if two runnables of this schedulable can be executed concurrently- Specified by:
acceptConcurrentExecution
in interfaceSchedulable
- Returns:
- true if two runnables of this schedulable can be executed concurrently
-
getParameters
Description copied from interface:Schedulable
Get the parameters for job execution- Specified by:
getParameters
in interfaceSchedulable
- Returns:
- the parameters
-