net.sourceforge.rssowl.controller.thread
Class SettingsManager

java.lang.Object
  extended by java.lang.Thread
      extended by net.sourceforge.rssowl.controller.thread.ExtendedThread
          extended by net.sourceforge.rssowl.controller.thread.SettingsManager
All Implemented Interfaces:
java.lang.Runnable

public class SettingsManager
extends ExtendedThread

The SettingsManager is responsible to save Settings in a certain interval. Whenever Favorites, Categories or Blogrolls are added, edited or removed, the SettingsManager is told to save Settings next time it checks for the isSaveRequested flag.

In addition, the Manager is also looking if the Archive is in need of flushing changes to the disk. The Archive is responsible of persisting the state of News that are marked as read.

Version:
1.2.4
Author:
Benjamin Pasero

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private static SettingsManager instance
           
private  boolean isSaveRequested
           
(package private)  GUI rssOwlGui
           
private static int SLEEP_INTERVAL
           
 
Fields inherited from class net.sourceforge.rssowl.controller.thread.ExtendedThread
stopped
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private SettingsManager(GUI rssOwlGui)
          Singleton Instantiation of SettingsManager.
 
Method Summary
static SettingsManager getInstance()
          Get the single instance of the SettingsManager.
private  void internalSaveSettings()
           
 void requestSave()
          Request save of Settings.
 void run()
           
 void stopThread()
          Stops this Thread by setting the stopped-flag to TRUE
 
Methods inherited from class net.sourceforge.rssowl.controller.thread.ExtendedThread
isStopped, startThread
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

instance

private static SettingsManager instance

SLEEP_INTERVAL

private static final int SLEEP_INTERVAL
See Also:
Constant Field Values

isSaveRequested

private boolean isSaveRequested

rssOwlGui

GUI rssOwlGui
Constructor Detail

SettingsManager

private SettingsManager(GUI rssOwlGui)
Singleton Instantiation of SettingsManager.

Parameters:
rssOwlGui - The Main Controller.
Method Detail

getInstance

public static SettingsManager getInstance()
Get the single instance of the SettingsManager.

Returns:
The single instance of the SettingsManager.

requestSave

public void requestSave()
Request save of Settings. Next time the Manager checks for the isSaveRequested flag, Settings will be saved.


run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
See Also:
Runnable.run()

internalSaveSettings

private void internalSaveSettings()

stopThread

public void stopThread()
Description copied from class: ExtendedThread
Stops this Thread by setting the stopped-flag to TRUE

Overrides:
stopThread in class ExtendedThread
See Also:
ExtendedThread.stopThread()


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo