Exemple #1
0
  public void saveAstManager() {
    File astOutputFile = getAstOutputFile();
    if (astOutputFile == null) {
      // The project was removed. Nothing to save here.
      Log.log(
          IStatus.INFO,
          "Not saving ast manager for: " + this.project + ". No write area available.",
          null);
      return;
    }

    if (astManager == null) {
      REF.writeToFile(null, astOutputFile);

    } else {
      synchronized (astManager.getLock()) {
        REF.writeToFile(astManager, astOutputFile);
      }
    }
  }
Exemple #2
0
 /**
  * Adds to both: the memory and the disk
  */
 public synchronized void add(String key, Serializable n) {
     synchronized(cache){
         super.add(key, n);
         File fileForKey = getFileForKey(key);
         if(DEBUG){
             System.out.println("Disk cache - Adding: "+key+" file: "+fileForKey);
         }
         REF.writeToFile(n, fileForKey);
         keys.add(key);
     }
 }
 private void saveTo(File pathToSave) {
   synchronized (lock) {
     if (DEBUG_ADDITIONAL_INFO) {
       System.out.println(
           "Saving info "
               + this.getClass().getName()
               + " to file (size = "
               + getAllTokens().size()
               + ") "
               + pathToSave);
     }
     REF.writeToFile(getInfoToSave(), pathToSave);
   }
 }