Class StaticRunnable
java.lang.Object
org.ametys.plugins.core.impl.schedule.StaticRunnable
- All Implemented Interfaces:
Runnable
,PluginAware
,Component
,Configurable
,Serviceable
- Direct Known Subclasses:
ConfigBasedDailyRunnable
,ConfigBasedEveryNMinutesRunnable
,InvalidateFOCacheRunnable
,ReloadSolrAclCachesForCoresRunnable
,SendNotificationSummaryRunnable
public class StaticRunnable
extends Object
implements Runnable, Component, Configurable, PluginAware, Serviceable
Static implementation of
Runnable
which is configurable-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.schedule.Runnable
Runnable.FireProcess, Runnable.MisfirePolicy
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The CRON expression for scheduling the jobprotected boolean
Can the runnable be deactivatedprotected I18nizableText
The descriptionprotected String
The name of the feature that declared this componentprotected Runnable.FireProcess
The fire processprotected String
The id of this extensionprotected I18nizableText
The labelprotected Runnable.MisfirePolicy
The misfire policy.protected boolean
Can the runnable be editedThe parameter valuesprotected String
The name of the plugin that declared this componentprotected boolean
Can the runnable be removedprotected SchedulableExtensionPoint
The extension point forSchedulable
sprotected String
The id of theSchedulable
to execute -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_configureParameterValues
(Configuration paramConfigs) Configure the values of the parametersvoid
configure
(Configuration configuration) Returns the cron expression to base the schedule on.Returns the descriptionGets the process of firing, i.e.getId()
Returns the idgetLabel()
Returns the labelGets the misfire policy, i.e.Gets the values of the parameters (from the linkedSchedulable
)Gets the identifier ofSchedulable
to executeGets the user which should be used to launch the runnable task.boolean
Determines if this runnable can be activate or deactivateboolean
Determines if this runnable can be modifiedboolean
Determines if this runnable can be removedboolean
Determines if the runnable must not survive to a server restartvoid
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.
-
Field Details
-
_schedulableEP
The extension point forSchedulable
s -
_pluginName
The name of the plugin that declared this component -
_featureName
The name of the feature that declared this component -
_id
The id of this extension -
_label
The label -
_description
The description -
_fireProcess
The fire process -
_cronExpression
The CRON expression for scheduling the job -
_schedulableId
The id of theSchedulable
to execute -
_removable
Can the runnable be removed -
_modifiable
Can the runnable be edited -
_deactivatable
Can the runnable be deactivated -
_misfirePolicy
The misfire policy. Default to MisfirePolicy#DO_NOTHING -
_parameterValues
The parameter values
-
-
Constructor Details
-
StaticRunnable
public StaticRunnable()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
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
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getId
Description copied from interface:Runnable
Returns the id -
getLabel
Description copied from interface:Runnable
Returns the label -
getDescription
Description copied from interface:Runnable
Returns the description- Specified by:
getDescription
in interfaceRunnable
- Returns:
- the i18n description
-
getFireProcess
Description copied from interface:Runnable
Gets the process of firing, i.e. the way the task will be scheduled (fire now, fire at next stratup, schedule it based on a cron expression...).- Specified by:
getFireProcess
in interfaceRunnable
- Returns:
- the fire process
-
getCronExpression
Description copied from interface:Runnable
Returns the cron expression to base the schedule on. Ignored ifRunnable.getFireProcess()
is different fromRunnable.FireProcess.CRON
.- Specified by:
getCronExpression
in interfaceRunnable
- Returns:
- the cron expression
-
getSchedulableId
Description copied from interface:Runnable
Gets the identifier ofSchedulable
to execute- Specified by:
getSchedulableId
in interfaceRunnable
- Returns:
- the identifier of
Schedulable
-
isRemovable
Description copied from interface:Runnable
Determines if this runnable can be removed- Specified by:
isRemovable
in interfaceRunnable
- Returns:
true
if this runnable is removable
-
isModifiable
Description copied from interface:Runnable
Determines if this runnable can be modified- Specified by:
isModifiable
in interfaceRunnable
- Returns:
true
if this runnable is modifiable
-
isDeactivatable
Description copied from interface:Runnable
Determines if this runnable can be activate or deactivate- Specified by:
isDeactivatable
in interfaceRunnable
- Returns:
true
if this runnable is deactivatable
-
getMisfirePolicy
Description copied from interface:Runnable
Gets the misfire policy, i.e. what the runnable must do if it missed a trigger. Ignored ifRunnable.getFireProcess()
is different fromRunnable.FireProcess.CRON
.- Specified by:
getMisfirePolicy
in interfaceRunnable
- Returns:
- The misfire policy
-
isVolatile
Description copied from interface:Runnable
Determines if the runnable must not survive to a server restart- Specified by:
isVolatile
in interfaceRunnable
- Returns:
- true if the runnable must not survive to a server restart
-
getParameterValues
Description copied from interface:Runnable
Gets the values of the parameters (from the linkedSchedulable
)- Specified by:
getParameterValues
in interfaceRunnable
- Returns:
- the parameter values
-
_configureParameterValues
Configure the values of the parameters- Parameters:
paramConfigs
- the configurations of the parameter values- Throws:
ConfigurationException
- if an error occurs
-
getUserIdentity
Description copied from interface:Runnable
Gets the user which should be used to launch the runnable task.- Specified by:
getUserIdentity
in interfaceRunnable
- Returns:
- the
UserIdentity
of the user
-