public abstract class AbstractStaticSchedulable extends AbstractLogEnabled implements Schedulable, Component, Configurable, PluginAware, Serviceable, Contextualizable
Schedulable
For implementing the Schedulable
interface (while being Configurable
), extends this class and implements the execute(org.quartz.JobExecutionContext)
method
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 + "!"); } }
Modifier and Type | Class and Description |
---|---|
class |
AbstractStaticSchedulable.SchedulableParameterParser
Class for parsing parameters of a
Schedulable |
Modifier and Type | Field and Description |
---|---|
protected boolean |
_acceptConcurrentExecution
True if two runnables of this schedulable can be executed concurrently
|
protected Context |
_context
The context
|
protected I18nizableText |
_description
The description
|
protected String |
_iconGlyph
The icon glyph
|
protected String |
_iconLarge
The large icon
|
protected String |
_iconMedium
The medium icon
|
protected String |
_iconSmall
The small icon
|
protected String |
_id
The id of this extension
|
protected I18nizableText |
_label
The label
|
protected Map<String,Parameter<ParameterHelper.ParameterType>> |
_parameters
The parameters
|
protected String |
_pluginName
The name of the plugin that has declared this component
|
protected boolean |
_private
True if the schedulable is private
|
protected ServiceManager |
_smanager
The service manager
|
Constructor and Description |
---|
AbstractStaticSchedulable() |
Modifier and Type | Method and Description |
---|---|
private void |
_configureParameters(Configuration paramConfigs) |
boolean |
acceptConcurrentExecution()
Returns true if two runnables of this schedulable can be executed concurrently
|
void |
configure(Configuration configuration) |
void |
contextualize(Context context) |
abstract void |
execute(JobExecutionContext context)
The action to perform when a trigger is fired.
|
I18nizableText |
getDescription()
Return the description
|
String |
getIconGlyph()
Returns the glyph icon
|
String |
getIconLarge()
Returns the path to the large icon in 48x48 pixels
|
String |
getIconMedium()
Returns the path to the medium icon in 32x32 pixels
|
String |
getIconSmall()
Returns the path to the small icon in 16x16 pixels
|
String |
getId()
Returns the id
|
I18nizableText |
getLabel()
Returns the label
|
Map<String,Parameter<ParameterHelper.ParameterType>> |
getParameters()
Get the parameters for job execution
|
boolean |
isPrivate()
Returns true if the schedulable is private
|
void |
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. |
getLogger, setLogger
protected String _pluginName
protected ServiceManager _smanager
protected I18nizableText _label
protected I18nizableText _description
protected String _iconGlyph
protected String _iconSmall
protected String _iconMedium
protected String _iconLarge
protected boolean _private
protected boolean _acceptConcurrentExecution
protected Map<String,Parameter<ParameterHelper.ParameterType>> _parameters
public AbstractStaticSchedulable()
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
private void _configureParameters(Configuration paramConfigs) throws ConfigurationException
ConfigurationException
public abstract void execute(JobExecutionContext context) throws Exception
Schedulable
execute
in interface Schedulable
context
- the contextException
- if an error occuredpublic String getId()
Schedulable
getId
in interface Schedulable
public I18nizableText getLabel()
Schedulable
getLabel
in interface Schedulable
public I18nizableText getDescription()
Schedulable
getDescription
in interface Schedulable
public String getIconGlyph()
Schedulable
getIconGlyph
in interface Schedulable
public String getIconSmall()
Schedulable
getIconSmall
in interface Schedulable
public String getIconMedium()
Schedulable
getIconMedium
in interface Schedulable
public String getIconLarge()
Schedulable
getIconLarge
in interface Schedulable
public boolean isPrivate()
Schedulable
isPrivate
in interface Schedulable
public boolean acceptConcurrentExecution()
Schedulable
acceptConcurrentExecution
in interface Schedulable
public Map<String,Parameter<ParameterHelper.ParameterType>> getParameters()
Schedulable
getParameters
in interface Schedulable