BrightSide Workbench Full Report + Source Code
org.turro.scheduler.task.AbstractTask Class Referenceabstract
Inheritance diagram for org.turro.scheduler.task.AbstractTask:
Collaboration diagram for org.turro.scheduler.task.AbstractTask:

Public Member Functions

void setConstructor (IConstructor constructor)
 
void setSettings (TaskSettings settings)
 
IConstructor getConstructor ()
 
TaskSettings getSettings ()
 
void setLastExecuted (Date lastExecuted)
 
boolean isDone ()
 
boolean shouldRun (Date now)
 
void doRun (Motor motor)
 
void stop ()
 
void run ()
 
abstract boolean isSystem ()
 
abstract String getName ()
 
abstract String getDataLabel ()
 
abstract void execute ()
 
String getColor ()
 
String getIcon ()
 
String getDescription ()
 
int compareTo (AbstractTask o)
 

Detailed Description

Member Function Documentation

◆ compareTo()

int org.turro.scheduler.task.AbstractTask.compareTo ( AbstractTask  o)

Definition at line 126 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

126  {
127  return Comparison.ascendant()
128  .compare(isSystem(), o.isSystem())
129  .compareTo(getSettings().compareTo(o.getSettings()))
130  .get();
131  }
Here is the call graph for this function:

◆ doRun()

void org.turro.scheduler.task.AbstractTask.doRun ( Motor  motor)

Definition at line 77 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

77  {
78  lastExecuted = new Date();
79  future = motor.runTask(this);
80  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute()

◆ getColor()

String org.turro.scheduler.task.AbstractTask.getColor ( )

Definition at line 108 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

108  {
109  return Colors.cssByName(isSystem() ? "DarkRed" : "DarkBlue");
110  }
Here is the call graph for this function:

◆ getConstructor()

IConstructor org.turro.scheduler.task.AbstractTask.getConstructor ( )

Definition at line 53 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

53  {
54  return constructor;
55  }
Here is the caller graph for this function:

◆ getDataLabel()

◆ getDescription()

String org.turro.scheduler.task.AbstractTask.getDescription ( )

Definition at line 116 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

116  {
117  return Phrases.start()
118  .add(getName(), "[]")
119  .add(getSettings().getDescription())
120  .toString();
121  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIcon()

String org.turro.scheduler.task.AbstractTask.getIcon ( )

Definition at line 112 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

112  {
113  return isSystem() ? "gears" : "user";
114  }
Here is the call graph for this function:

◆ getName()

◆ getSettings()

TaskSettings org.turro.scheduler.task.AbstractTask.getSettings ( )

Definition at line 57 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

57  {
58  if(settings == null) settings = TaskSettings.from(this);
59  return settings;
60  }
static TaskSettings from(AbstractTask task)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDone()

boolean org.turro.scheduler.task.AbstractTask.isDone ( )

Definition at line 66 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

66  {
67  return future == null ? true : future.isDone();
68  }
Here is the caller graph for this function:

◆ isSystem()

◆ run()

void org.turro.scheduler.task.AbstractTask.run ( )

Definition at line 89 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

89  {
90  try {
91  execute();
92  } catch(Exception ex) {
93  WebLoggers.warning(this).exception(ex).log();
94  }
95  }
Here is the call graph for this function:

◆ setConstructor()

void org.turro.scheduler.task.AbstractTask.setConstructor ( IConstructor  constructor)

Definition at line 45 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

45  {
46  this.constructor = constructor;
47  }
Here is the caller graph for this function:

◆ setLastExecuted()

void org.turro.scheduler.task.AbstractTask.setLastExecuted ( Date  lastExecuted)

Definition at line 62 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

62  {
63  this.lastExecuted = lastExecuted;
64  }

◆ setSettings()

void org.turro.scheduler.task.AbstractTask.setSettings ( TaskSettings  settings)

Definition at line 49 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

49  {
50  this.settings = settings;
51  }
Here is the caller graph for this function:

◆ shouldRun()

boolean org.turro.scheduler.task.AbstractTask.shouldRun ( Date  now)

Definition at line 70 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

70  {
71  if(enoughTimeLapse(now) && settings.shouldRun(now)) {
72  return settings.getConstraints().needsRefresh();
73  }
74  return false;
75  }
Here is the call graph for this function:

◆ stop()

void org.turro.scheduler.task.AbstractTask.stop ( )

Definition at line 82 of file elephant-scheduler/src/main/java/org/turro/scheduler/task/AbstractTask.java.

82  {
83  if(future != null && !future.isDone()) {
84  future.cancel(true);
85  }
86  }
Here is the caller graph for this function:

The documentation for this class was generated from the following file: