@Override
 public void initializeListener(ViatraQueryEngine engine) {
   this.engine = engine;
   for (ITransformationBreakpointHandler breakpoint : breakpoints) {
     if (breakpoint instanceof ConditionalTransformationBreakpointHandler && engine != null) {
       try {
         ((ConditionalTransformationBreakpointHandler) breakpoint).setEngine(engine);
       } catch (ViatraDebuggerException e) {
         ViatraQueryLoggingUtil.getDefaultLogger().error(e.getMessage(), e);
       }
     }
   }
 }
  @Override
  public void disposeListener() {
    List<IDebuggerTargetAgent> listenersToRemove = Lists.newArrayList();

    for (IDebuggerTargetAgent listener : agents) {
      try {
        listener.terminated();
        listenersToRemove.add(listener);
      } catch (ViatraDebuggerException e) {
        ViatraQueryLoggingUtil.getDefaultLogger().error(e.getMessage(), e);
      }
    }

    for (IDebuggerTargetAgent iDebuggerTargetAgent : listenersToRemove) {
      unRegisterTransformationDebugListener(iDebuggerTargetAgent);
    }

    agents.clear();
    breakpoints.clear();
  }