Beispiel #1
0
 private final void save() {
   if (saveRecordFile) {
     Resource resource = record.eResource();
     if (resource != null) {
       try {
         resource.save(EmfXmlUtil.defaultLoadSaveOptions());
       } catch (IOException e) {
         Throwables.propagate(e);
       }
     }
   }
 }
Beispiel #2
0
  public void record(Record record) {
    this.record = record;
    dataBaseAdapter.initialize(record, true);
    for (Node node : record.getConfiguration().getNodes()) {
      if (!node.getErrors().isEmpty()) {}

      RecordHandlerEventListener listener = new RecordHandlerEventListener(node);
      INodeConnection nodeConnection = ncp.createConnection(node);
      nodeConnection.getAdapter(IErrorAdapter.class).addErrorListener(this);
      IHandlerEventAdapter hea = nodeConnection.getAdapter(IHandlerEventAdapter.class);
      hea.addEventListener(Recorder.class, listener);
      logger.log(ILogger.DEBUG, "started recording for " + node.getINetAddress(), null);
    }
  }
Beispiel #3
0
 public void stop() {
   if (record == null) {
     return;
   }
   for (Node node : record.getConfiguration().getNodes()) {
     INodeConnection nodeConnection = node.getConnection();
     IHandlerEventAdapter hea = nodeConnection.getAdapter(IHandlerEventAdapter.class);
     RecordHandlerEventListener listener =
         (RecordHandlerEventListener) hea.getEventListener(Recorder.class);
     hea.removeEventListener(Recorder.class);
     listener.dispose();
     dataBaseAdapter.close();
     logger.log(ILogger.DEBUG, "stop recording for " + node.getINetAddress(), null);
   }
 }