- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 39 of file Motor.java.
◆ getInstance() [1/3]
static Motor org.turro.scheduler.motor.Motor.getInstance |
( |
| ) |
|
|
static |
◆ getInstance() [2/3]
static Motor org.turro.scheduler.motor.Motor.getInstance |
( |
IConstructor |
constructor, |
|
|
long |
period, |
|
|
TimeUnit |
unit |
|
) |
| |
|
static |
Definition at line 66 of file Motor.java.
67 return getInstance(constructor, period, unit,
false);
static Motor getInstance()
◆ getInstance() [3/3]
static synchronized Motor org.turro.scheduler.motor.Motor.getInstance |
( |
IConstructor |
constructor, |
|
|
long |
period, |
|
|
TimeUnit |
unit, |
|
|
boolean |
forceNew |
|
) |
| |
|
static |
Definition at line 70 of file Motor.java.
71 if(forceNew && motor !=
null) motor.
stop();
72 if(motor ==
null || forceNew) motor =
new Motor(constructor, period, unit);
◆ getTasks()
Set<AbstractTask> org.turro.scheduler.motor.Motor.getTasks |
( |
| ) |
|
◆ run()
void org.turro.scheduler.motor.Motor.run |
( |
| ) |
|
Definition at line 81 of file Motor.java.
82 Thread.currentThread().setName(
"ElephantTaskMotorPool");
83 Date now =
new Date();
85 for(AbstractTask task : tasks) {
86 if(handle.isCancelled())
break;
88 task.getSettings().isActive() &&
89 task.shouldRun(now)) {
90 WebLoggers.info(
this).message(I_.format(
"%s:%s started.",
91 task.getName(), task.getSettings().getDescription())).log();
96 CheckDate cd =
new CheckDate(now);
97 int dayOfYear = cd.getDayOfYear();
98 if(dayOfYear != entityDay) {
99 entityDay = dayOfYear;
100 entityTask =
new EntityTask();
101 WebLoggers.info(
this).message(I_.format(
"%s:%s started.",
103 entityTask.
doRun(
this);
◆ runTask()
ScheduledFuture<?> org.turro.scheduler.motor.Motor.runTask |
( |
AbstractTask |
task | ) |
|
Definition at line 125 of file Motor.java.
126 return scheduler.schedule(task, 5, TimeUnit.SECONDS);
◆ stop()
void org.turro.scheduler.motor.Motor.stop |
( |
| ) |
|
Definition at line 109 of file Motor.java.
110 for(AbstractTask task : tasks) {
112 WebLoggers.info(
this).message(I_.format(
"%s:%s stopped.",
113 task.getName(), task.getSettings().getDescription())).log();
115 if(entityTask !=
null) {
117 WebLoggers.info(
this).message(I_.format(
"%s:%s stopped.",
121 scheduler.shutdown();
122 WebLoggers.info(
this).message(
"Scheduler shutdown.").log();
The documentation for this class was generated from the following file: