src/share/classes/sun/rmi/log/ReliableLog.java

Print this page
rev 3756 : 6896297: (rmi) fix ConcurrentModificationException causing TCK failure
Reviewed-by: XXX


 363      * @param value the object representing the new snapshot
 364      * @exception IOException If an exception occurred during the
 365      * snapshot callback or if other I/O error has occurred during the
 366      * snapshot process
 367      */
 368     public synchronized void snapshot(Object value)
 369         throws IOException
 370     {
 371         int oldVersion = version;
 372         incrVersion();
 373 
 374         String fname = versionName(snapshotPrefix);
 375         File snapshotFile = new File(fname);
 376         FileOutputStream out = new FileOutputStream(snapshotFile);
 377         try {
 378             try {
 379                 handler.snapshot(out, value);
 380             } catch (IOException e) {
 381                 throw e;
 382             } catch (Exception e) {
 383                 throw new IOException("snapshot failed with exception of type: " +
 384                                       e.getClass().getName() +
 385                                       ", message was: " + e.getMessage());
 386             }
 387             lastSnapshot = System.currentTimeMillis();
 388         } finally {
 389             out.close();
 390             snapshotBytes = snapshotFile.length();
 391         }
 392 
 393         openLogFile(true);
 394         writeVersionFile(true);
 395         commitToNewVersion();
 396         deleteSnapshot(oldVersion);
 397         deleteLogFile(oldVersion);
 398     }
 399 
 400     /**
 401      * Close the stable storage directory in an orderly manner.
 402      *
 403      * @exception IOException If an I/O error occurs when the log is
 404      * closed
 405      */




 363      * @param value the object representing the new snapshot
 364      * @exception IOException If an exception occurred during the
 365      * snapshot callback or if other I/O error has occurred during the
 366      * snapshot process
 367      */
 368     public synchronized void snapshot(Object value)
 369         throws IOException
 370     {
 371         int oldVersion = version;
 372         incrVersion();
 373 
 374         String fname = versionName(snapshotPrefix);
 375         File snapshotFile = new File(fname);
 376         FileOutputStream out = new FileOutputStream(snapshotFile);
 377         try {
 378             try {
 379                 handler.snapshot(out, value);
 380             } catch (IOException e) {
 381                 throw e;
 382             } catch (Exception e) {
 383                 throw new IOException("snapshot failed", e);


 384             }
 385             lastSnapshot = System.currentTimeMillis();
 386         } finally {
 387             out.close();
 388             snapshotBytes = snapshotFile.length();
 389         }
 390 
 391         openLogFile(true);
 392         writeVersionFile(true);
 393         commitToNewVersion();
 394         deleteSnapshot(oldVersion);
 395         deleteLogFile(oldVersion);
 396     }
 397 
 398     /**
 399      * Close the stable storage directory in an orderly manner.
 400      *
 401      * @exception IOException If an I/O error occurs when the log is
 402      * closed
 403      */