private synchronized void saveSnapshot() { while (!finished2) { try { this.wait(); } catch (InterruptedException ie) { // do nothing } } try { LoggerSession loggerSession = pvLogger.requestLoggerSession("SCL HOM"); // give 5 seconds for channel connection try { Thread.sleep(5000); } catch (InterruptedException ie) { // do nothing } snapshot = loggerSession.takeSnapshot(); startTime = new Date(); // attach the date to the snapshot comment field String comments = startTime.toString(); comments = comments + "\n" + "For SCL Monitor Application"; snapshot.setComment(comments); loggerSession.publishSnapshot(snapshot); } catch (Exception exception) { throw new RuntimeException(exception); } finished2 = false; finished3 = true; this.notify(); }