org.eclipse.mylar.internal.tasks.ui
Class TaskListSynchronizationScheduler

java.lang.Object
  extended by org.eclipse.mylar.internal.tasks.ui.TaskListSynchronizationScheduler
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.util.IPropertyChangeListener

public class TaskListSynchronizationScheduler
extends java.lang.Object
implements org.eclipse.jface.util.IPropertyChangeListener

Author:
Rob Elves, Mik Kersten

Nested Class Summary
(package private) static class TaskListSynchronizationScheduler.MutexRule
           
 
Field Summary
private static int DELAY_QUERY_REFRESH_ON_STARTUP
           
private  java.util.List<ScheduledTaskListSynchJob> jobs
           
private  java.util.List<ScheduledTaskListSynchJob> jobsQueue
           
private  ScheduledTaskListSynchJob refreshJob
           
private  TaskListSynchronizationScheduler.MutexRule rule
           
 
Constructor Summary
TaskListSynchronizationScheduler(boolean refreshOnStartup)
           
 
Method Summary
private  void addJobToQueue(ScheduledTaskListSynchJob jobToAdd)
           
 void cancelAll()
           
 ScheduledTaskListSynchJob getRefreshJob()
           
 void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
           
private  void scheduleRegularSynchronizationJob()
           
 void startSynchJob()
           
 void synchNow(long delay, java.util.List<TaskRepository> repositories)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELAY_QUERY_REFRESH_ON_STARTUP

private static final int DELAY_QUERY_REFRESH_ON_STARTUP
See Also:
Constant Field Values

refreshJob

private ScheduledTaskListSynchJob refreshJob

jobs

private java.util.List<ScheduledTaskListSynchJob> jobs

jobsQueue

private java.util.List<ScheduledTaskListSynchJob> jobsQueue

rule

private final TaskListSynchronizationScheduler.MutexRule rule
Constructor Detail

TaskListSynchronizationScheduler

public TaskListSynchronizationScheduler(boolean refreshOnStartup)
Method Detail

startSynchJob

public void startSynchJob()

scheduleRegularSynchronizationJob

private void scheduleRegularSynchronizationJob()

addJobToQueue

private void addJobToQueue(ScheduledTaskListSynchJob jobToAdd)

synchNow

public void synchNow(long delay,
                     java.util.List<TaskRepository> repositories)
Parameters:
delay - sync delay (ms)
repositories - used to scope sync to queries associated with given repositories, can be null (sync all repositories)

propertyChange

public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
Specified by:
propertyChange in interface org.eclipse.jface.util.IPropertyChangeListener

getRefreshJob

public ScheduledTaskListSynchJob getRefreshJob()

cancelAll

public void cancelAll()