if (vsess==null)
throw new Error("ArchiveClient instance is invalid!.");
}
+ /**
+ * set this to false if watch loop should end immediately
+ */
+ protected boolean watchForChange=true;
public static int WATCH_SLEEP=300;
/**
* watch the document file for updates.
valid();
vsess.unLock(); // doh.
FileWatcher watcher = new FileWatcher(vsess.getVamsasFile());
+ // watcher.setState();
+ watchForChange=true;
long endtime=System.currentTimeMillis()+time;
try {
org.vamsas.client.simpleclient.Lock doclock;
- //watcher.setState();
do {
doclock=watcher.getChangedState();
if (doclock==null)
Thread.sleep(WATCH_SLEEP);
- } while (doclock==null && (time==0 || endtime>System.currentTimeMillis())); // tuning.
+ } while (watchForChange && doclock==null && (time==0 || endtime>System.currentTimeMillis())); // tuning.
if (doclock==null)
return null;
else {