Class SmartExecutorTask
java.lang.Object
org.gcube.vremanagement.executor.scheduler.SmartExecutorTask
- All Implemented Interfaces:
org.quartz.InterruptableJob,org.quartz.Job
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe Context the task runs in.static final Stringprotected intprotected booleanprotected Booleanstatic final Stringprotected org.gcube.vremanagement.executor.api.types.LaunchParameterprotected intprotected booleanstatic final Stringprotected Stringprotected org.gcube.vremanagement.executor.plugin.Pluginprotected Stringprotected List<org.gcube.vremanagement.executor.plugin.PluginStateNotification>protected RunnablePlugin<org.gcube.vremanagement.executor.plugin.Plugin>protected UUIDstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(org.quartz.JobExecutionContext context) protected voidfinished(org.quartz.JobExecutionContext context) static voidForgets the executions of a task that is no longer scheduled.org.gcube.vremanagement.executor.api.types.LaunchParametergetUUID()protected voidinit(org.quartz.JobDataMap jobDataMap) voidprotected booleanprotected static org.gcube.vremanagement.executor.plugin.PluginStateNotificationnewPluginStateNotification(String className, Map<String, String> inputs) Builds a notification requested by a task.toString()protected voidunschedule(boolean globally)
-
Field Details
-
UUID
- See Also:
-
LAUNCH_PARAMETER
- See Also:
-
OWNER_ID
- See Also:
-
CONTEXT
- See Also:
-
executionsCount
-
executionsState
-
pluginStateNotifications
protected List<org.gcube.vremanagement.executor.plugin.PluginStateNotification> pluginStateNotifications -
initialized
protected boolean initialized -
uuid
-
launchParameter
protected org.gcube.vremanagement.executor.api.types.LaunchParameter launchParameter -
ownerId
-
context
The Context the task runs in. -
executionCount
protected int executionCount -
pluginName
-
plugin
protected org.gcube.vremanagement.executor.plugin.Plugin plugin -
inputs
-
runnablePlugin
-
mustPreviousExecutionsCompleted
protected boolean mustPreviousExecutionsCompleted -
maxExecutionNumber
protected int maxExecutionNumber -
interrupted
-
-
Constructor Details
-
SmartExecutorTask
- Throws:
Exception
-
-
Method Details
-
getExecutionsCount
- Returns:
- the executionsCount
-
forget
Forgets the executions of a task that is no longer scheduled.- Parameters:
uuid- the UUID of the task
-
init
protected void init(org.quartz.JobDataMap jobDataMap) throws org.quartz.JobExecutionException - Throws:
org.quartz.JobExecutionException
-
newPluginStateNotification
protected static org.gcube.vremanagement.executor.plugin.PluginStateNotification newPluginStateNotification(String className, Map<String, String> inputs) throws ExceptionBuilds a notification requested by a task. The name comes from the request: the class is loaded without being initialised, and it must be aPluginStateNotificationbefore any of its code runs.- Parameters:
className- the name of the classinputs- the inputs given to its constructor- Returns:
- the notification
- Throws:
Exception- if the class does not exist, is not a PluginStateNotification or has no constructor taking the inputs
-
getUUID
- Returns:
- the uuid
-
getLaunchParameter
public org.gcube.vremanagement.executor.api.types.LaunchParameter getLaunchParameter()- Returns:
- the parameter
-
execute
public void execute(org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException - Specified by:
executein interfaceorg.quartz.Job- Throws:
org.quartz.JobExecutionException
-
finished
protected void finished(org.quartz.JobExecutionContext context) -
interrupt
public void interrupt() throws org.quartz.UnableToInterruptJobException- Specified by:
interruptin interfaceorg.quartz.InterruptableJob- Throws:
org.quartz.UnableToInterruptJobException
-
isMaxExecutionNumberReached
protected boolean isMaxExecutionNumberReached() -
unschedule
- Throws:
Exception
-
toString
-