Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IPreference


   */
  public int getInteger(String key) {
    synchronized (fCache) {

      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getInteger() != null)
        return cachedPref.getInteger();

      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getInteger() != null) {
        fCache.put(key, pref);
        return pref.getInteger();
      }

      /* Ask Parent */
      int parentValue = fParent.getInteger(key);

      /* Cache value from parent */
      pref = Owl.getModelFactory().createPreference(key);
      pref.putIntegers(parentValue);
      fCache.put(key, pref);

      return parentValue;
    }
  }
View Full Code Here


   */
  public int[] getIntegers(String key) {
    synchronized (fCache) {

      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getIntegers() != null)
        return cachedPref.getIntegers();

      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getIntegers() != null) {
        fCache.put(key, pref);
        return pref.getIntegers();
      }

      /* Ask Parent */
      int[] parentValue = fParent.getIntegers(key);

      /* Cache value from parent */
      if (parentValue != null) {
        pref = Owl.getModelFactory().createPreference(key);
        pref.putIntegers(parentValue);
        fCache.put(key, pref);
      }

      return parentValue;
    }
View Full Code Here

   */
  public long getLong(String key) {
    synchronized (fCache) {

      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getLong() != null)
        return cachedPref.getLong();

      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getLong() != null) {
        fCache.put(key, pref);
        return pref.getLong();
      }

      /* Ask Parent */
      long parentValue = fParent.getLong(key);

      /* Cache value from parent */
      pref = Owl.getModelFactory().createPreference(key);
      pref.putLongs(parentValue);
      fCache.put(key, pref);

      return parentValue;
    }
  }
View Full Code Here

   */
  public long[] getLongs(String key) {
    synchronized (fCache) {

      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getLongs() != null)
        return cachedPref.getLongs();

      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getLongs() != null) {
        fCache.put(key, pref);
        return pref.getLongs();
      }

      /* Ask Parent */
      long[] parentValue = fParent.getLongs(key);

      /* Cache value from parent */
      if (parentValue != null) {
        pref = Owl.getModelFactory().createPreference(key);
        pref.putLongs(parentValue);
        fCache.put(key, pref);
      }

      return parentValue;
    }
View Full Code Here

   */
  public String getString(String key) {
    synchronized (fCache) {

      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getString() != null)
        return cachedPref.getString();

      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getString() != null) {
        fCache.put(key, pref);
        return pref.getString();
      }

      /* Ask Parent */
      String parentValue = fParent.getString(key);

      /* Cache value from parent */
      if (parentValue != null) {
        pref = Owl.getModelFactory().createPreference(key);
        pref.putStrings(parentValue);
        fCache.put(key, pref);
      }

      return parentValue;
    }
View Full Code Here

   */
  public String[] getStrings(String key) {
    synchronized (fCache) {

      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getStrings() != null)
        return cachedPref.getStrings();

      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getStrings() != null) {
        fCache.put(key, pref);
        return pref.getStrings();
      }

      /* Ask Parent */
      String[] parentValue = fParent.getStrings(key);

      /* Cache value from parent */
      if (parentValue != null) {
        pref = Owl.getModelFactory().createPreference(key);
        pref.putStrings(parentValue);
        fCache.put(key, pref);
      }

      return parentValue;
    }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putBooleans(value);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putIntegers(value);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putIntegers(values);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putLongs(value);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.IPreference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.