From: jprocter Date: Fri, 20 Jan 2006 08:50:30 +0000 (+0000) Subject: more locked IO performance tests. X-Git-Tag: Release_0.2~369 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ed3c3a256f9dc365f9e287eb8b05cd7930fff568;p=vamsas.git more locked IO performance tests. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@151 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/org/vamsas/client/simpleclient/VamsasArchive.java b/src/org/vamsas/client/simpleclient/VamsasArchive.java index f55d3d8..ea11a81 100644 --- a/src/org/vamsas/client/simpleclient/VamsasArchive.java +++ b/src/org/vamsas/client/simpleclient/VamsasArchive.java @@ -263,10 +263,8 @@ public class VamsasArchive { if (rchive==null) rchive = new SessionFile(archive); - archive.createNewFile(); if (!rchive.lockFile()) throw new IOException("Failed to get lock on file "+archive); - newarchive = new JarOutputStream(new BufferedOutputStream(new java.io.FileOutputStream(archive))); entries = new Hashtable(); } diff --git a/src/org/vamsas/client/simpleclient/VamsasFile.java b/src/org/vamsas/client/simpleclient/VamsasFile.java index 4199dd2..dbff158 100644 --- a/src/org/vamsas/client/simpleclient/VamsasFile.java +++ b/src/org/vamsas/client/simpleclient/VamsasFile.java @@ -68,7 +68,9 @@ public class VamsasFile extends SessionFile { ; return fileLock; } - + public void unLock() { + this.unlockFile(); + } public java.io.Reader getDocumentReader() { try { diff --git a/src/org/vamsas/test/simpleclient/ArchiveReports.java b/src/org/vamsas/test/simpleclient/ArchiveReports.java index b38f87a..c970552 100644 --- a/src/org/vamsas/test/simpleclient/ArchiveReports.java +++ b/src/org/vamsas/test/simpleclient/ArchiveReports.java @@ -107,7 +107,7 @@ public class ArchiveReports { } return true; } else { - outstr.print("Document Object is null"); + outstr.println("Document Object is null"); } return false; } diff --git a/src/org/vamsas/test/simpleclient/ArchiveWatcher.java b/src/org/vamsas/test/simpleclient/ArchiveWatcher.java index 23396a6..8340413 100644 --- a/src/org/vamsas/test/simpleclient/ArchiveWatcher.java +++ b/src/org/vamsas/test/simpleclient/ArchiveWatcher.java @@ -26,7 +26,7 @@ public class ArchiveWatcher { archive.createNewFile(); */ // watch the new file... - taken straight from ClientsFileTest FileWatcher w = new FileWatcher(archive); - while (archive.exists()) { + while (true) { // get watcher's lock to ensure state change is fixed for retrieval Lock chlock = w.getChangedState();