public class RunTaskJob extends org.jdesktop.application.Task<Void,Void>
org.jdesktop.application.Task.BlockingScope, org.jdesktop.application.Task.InputBlocker
SwingWorker.StateValue
Modifier and Type | Field and Description |
---|---|
protected Collection<TimerAlert> |
alreadyTrownAlerts
Already thrown alert.
|
protected AtomicBoolean |
bWantToStop
Want to stop flag.
|
protected TimerDataManager |
dataManager
Data manager.
|
protected AtomicLong |
lastUserActivity
Last publish time to detect hibernate.
|
protected TimerTask |
managedTask
The task to manage.
|
protected JTimer |
parentApp
Parent app reference.
|
protected SystemInfo |
systemInfo
System information (idle...).
|
Constructor and Description |
---|
RunTaskJob(JTimer parentApp,
TimerTask managedTask,
TimerDataManager dataManager)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addTaskDelta(long from,
long delta)
Add task delta.
|
protected void |
checkAlreadyThrownAlerts(TimerTask task)
Check for already thrown alerts.
|
protected void |
checkTaskAlerts(TimerTask task)
Check for alert to be fired.
|
protected void |
displayAlert(TimerTask task,
TimerAlert.Type alertType,
long alertDuration)
Display alert message without breaking UI.
|
protected Void |
doInBackground() |
TimerTask |
getTask()
Task getter.
|
boolean |
isStopping()
Tell if task is trying to stop.
|
void |
wantToStop()
Notify that task want to stop
|
addTaskListener, cancelled, done, failed, finished, getApplication, getContext, getDescription, getExecutionDuration, getInputBlocker, getMessage, getMessageDuration, getResourceMap, getTaskListeners, getTaskService, getTitle, getUserCanCancel, interrupted, isPending, isProgressPropertyValid, isStarted, message, process, removeTaskListener, resourceName, setDescription, setInputBlocker, setMessage, setProgress, setProgress, setProgress, setTitle, setUserCanCancel, succeeded
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress
protected JTimer parentApp
protected TimerTask managedTask
protected TimerDataManager dataManager
protected SystemInfo systemInfo
protected Collection<TimerAlert> alreadyTrownAlerts
protected AtomicLong lastUserActivity
protected AtomicBoolean bWantToStop
public RunTaskJob(JTimer parentApp, TimerTask managedTask, TimerDataManager dataManager)
parentApp
- parent applicationmanagedTask
- taskdataManager
- dataprotected void checkAlreadyThrownAlerts(TimerTask task)
task
- current taskpublic TimerTask getTask()
protected Void doInBackground() throws Exception
doInBackground
in class SwingWorker<Void,Void>
Exception
protected void addTaskDelta(long from, long delta)
from
- time when delta was notifieddelta
- delta to addprotected void checkTaskAlerts(TimerTask task)
task
- protected void displayAlert(TimerTask task, TimerAlert.Type alertType, long alertDuration)
task
- taskalertType
- alert typealertDuration
- alert durationpublic void wantToStop()
public boolean isStopping()
Copyright © 2007–2013 CodeLutin. All rights reserved.