public abstract class JobBase extends Object implements Runnable
| Constructor and Description |
|---|
JobBase()
Create a new job with randomly generated name.
|
JobBase(String jobName)
Create a new job with specified name.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
awaitInteraction()
Await external interaction from job controller.
|
LocalDateTime |
calculateNextFireDateTime(LocalDateTime from)
Calculate the date and time of next fire according to job configuration.
|
String |
getInstanceName() |
String |
getJobName()
Get the name of this job.
|
protected JobController.InteractionType |
getLatestInteraction()
Get the latest interaction from job controller.
|
String |
getParameter(String name)
Get parameter value.
|
SystemConfig.JobConfig |
getTimerConfig() |
protected boolean |
isPaused() |
protected void |
onEvent(Object event) |
protected boolean |
pause() |
protected void |
pauseInternalBrowser()
Pause the execution of internal browser.
|
void |
raiseEvent(Object event)
Raise an event from this job.
|
void |
receiveEvent(Object event)
Receive an event from the other jobs.
|
protected boolean |
registerInternalBrowserTask(org.kquiet.browser.ActionComposer task)
Register a browser task to be executed in internal browser.
|
protected void |
restartInternalBrowser()
Restart internal browser of controlling job controller.
|
protected boolean |
resume() |
protected void |
resumeInternalBrowser()
Resume the execution of internal browser.
|
abstract void |
run()
The processing logic of job goes here.
|
JobBase |
setJobController(JobController ctrl) |
public JobBase()
public JobBase(String jobName)
jobName - the name of jobpublic final JobBase setJobController(JobController ctrl)
public abstract void run()
protected boolean pause()
protected boolean isPaused()
protected boolean resume()
public final LocalDateTime calculateNextFireDateTime(LocalDateTime from)
from - the LocalDateTime to calculate fromLocalDateTime of next firepublic final void raiseEvent(Object event)
event - the event to raisepublic final void receiveEvent(Object event)
event - the event to receiveprotected void onEvent(Object event)
public final String getInstanceName()
public final SystemConfig.JobConfig getTimerConfig()
public final String getParameter(String name)
name - the name of parameterprotected final void restartInternalBrowser()
protected final void pauseInternalBrowser()
protected final void resumeInternalBrowser()
protected final boolean registerInternalBrowserTask(org.kquiet.browser.ActionComposer task)
task - browser taskprotected final void awaitInteraction()
protected final JobController.InteractionType getLatestInteraction()
public final String getJobName()
Copyright © 2019. All rights reserved.