Example #1
0
  /* (non-Javadoc)
   * @see v9t9.common.demo.IDemoActor#connectForRecording(v9t9.common.demo.IDemoRecorder)
   */
  @Override
  public void connectForRecording(final IDemoRecorder recorder) throws IOException {
    pauseDemoSetting = Settings.get(recorder.getMachine(), IDemoHandler.settingDemoPaused);

    timerTask =
        new Runnable() {

          @Override
          public void run() {
            try {
              synchronized (recorder) {
                IDemoOutputStream os = recorder.getOutputStream();
                if (os != null) {
                  recorder.flushData();
                }
              }
            } catch (final Throwable t) {
              recorder.fail(t);
            }
          }
        };

    timer.scheduleTask(timerTask, recorder.getOutputStream().getTimerRate());
  }
Example #2
0
 /* (non-Javadoc)
  * @see v9t9.common.demo.IDemoActor#disconnectFromRecording(v9t9.common.demo.IDemoRecorder)
  */
 @Override
 public void disconnectFromRecording(IDemoRecorder recorder) {
   timer.cancelTask(timerTask);
   timer.cancel();
 }