org.eclipse.mylar.internal.tasks.ui.util
Class BackgroundSaveTimer

java.lang.Object
  extended by org.eclipse.mylar.internal.tasks.ui.util.BackgroundSaveTimer
All Implemented Interfaces:
org.eclipse.mylar.internal.context.core.util.ITimerThreadListener

public class BackgroundSaveTimer
extends java.lang.Object
implements org.eclipse.mylar.internal.context.core.util.ITimerThreadListener

Timer that periodically runs saveRequested() on its client as a job

Author:
Wesley Coelho

Nested Class Summary
private  class BackgroundSaveTimer.SaveJob
          Job that makes the save call
 
Field Summary
private static int DEFAULT_SAVE_INTERVAL
           
private  boolean forceSyncExec
           
private  IBackgroundSaveListener listener
           
private  int saveInterval
           
private  org.eclipse.mylar.internal.context.core.util.TimerThread timer
           
 
Constructor Summary
BackgroundSaveTimer(IBackgroundSaveListener listener)
           
 
Method Summary
 void fireTimedOut()
          Called by the ActivityTimerThread Calls save in a new job
 int getSaveIntervalMillis()
           
 void intervalElapsed()
           
 void setForceSyncExec(boolean forceSyncExec)
          For testing
 void setSaveIntervalMillis(int saveIntervalMillis)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SAVE_INTERVAL

private static final int DEFAULT_SAVE_INTERVAL
See Also:
Constant Field Values

saveInterval

private int saveInterval

listener

private IBackgroundSaveListener listener

timer

private org.eclipse.mylar.internal.context.core.util.TimerThread timer

forceSyncExec

private boolean forceSyncExec
Constructor Detail

BackgroundSaveTimer

public BackgroundSaveTimer(IBackgroundSaveListener listener)
Method Detail

start

public void start()

stop

public void stop()

setSaveIntervalMillis

public void setSaveIntervalMillis(int saveIntervalMillis)

getSaveIntervalMillis

public int getSaveIntervalMillis()

setForceSyncExec

public void setForceSyncExec(boolean forceSyncExec)
For testing


fireTimedOut

public void fireTimedOut()
Called by the ActivityTimerThread Calls save in a new job

Specified by:
fireTimedOut in interface org.eclipse.mylar.internal.context.core.util.ITimerThreadListener

intervalElapsed

public void intervalElapsed()
Specified by:
intervalElapsed in interface org.eclipse.mylar.internal.context.core.util.ITimerThreadListener