Code example for AtomicLong

Methods: longValue

0
   * Write SCN value to file. If SCN file exists, move it aside and create a new file 
   * w/new value. 
   */ 
  private void writeScnToFile() throws IOException 
  { 
    long scn = _scn.longValue();
 
    File dir = _staticConfig.getScnDir();
    if (! dir.exists() && !dir.mkdirs())
    { 
      throw new IOException("unable to create SCN file parent:" + dir.getAbsolutePath());
    } 
 
    // delete the temp file if one exists 
    File tempScnFile = new File(_scnFileName + TEMP);
    if (tempScnFile.exists() && !tempScnFile.delete())
    { 
      LOG.error("unable to erase temp SCN file: " + tempScnFile.getAbsolutePath());
    } 
 
    File scnFile = new File(_scnFileName);