private void conflictSetChanged(TransformationDebuggerConflictSet set) {
   nextActivations = Sets.newHashSet(set.getNextActivations());
   conflictingActivations = Sets.newHashSet(set.getConflictingActivations());
   for (IDebuggerTargetAgent listener : agents) {
     listener.conflictSetChanged(nextActivations, conflictingActivations);
   }
 }
 @Override
 public void addedRule(RuleSpecification<?> specification, EventFilter<?> filter) {
   rules.add(new Pair<RuleSpecification<?>, EventFilter<?>>(specification, filter));
   for (IDebuggerTargetAgent listener : agents) {
     listener.addedRule(specification, filter);
   }
 }
    @Override
    public Activation<?> next() {

      nextActivation = delegatedIterator.next();

      for (IDebuggerTargetAgent listener : agents) {
        listener.activationFiring(nextActivation);
      }

      if (nextActivation != null
          && (hasBreakpoint(nextActivation) || action == DebuggerActions.Step)) {

        for (IDebuggerTargetAgent listener : agents) {
          listener.suspended();
        }

        while (!actionSet) {
          try {
            Thread.sleep(25);
          } catch (InterruptedException e) {
            ViatraQueryLoggingUtil.getDefaultLogger().error(e.getMessage(), e);
          }
        }
        actionSet = false;
      }

      return nextActivation;
    }
 public void setNextActivation(ActivationTrace trace) {
   for (Activation<?> act : conflictingActivations) {
     if (ActivationTraceUtil.compareActivationCodes(
         trace, activationCoder.createActivationCode(act))) {
       this.nextActivation = act;
       for (IDebuggerTargetAgent listener : agents) {
         listener.nextActivationChanged(nextActivation);
       }
       return;
     }
   }
 }
 private boolean hasBreakpoint(Activation<?> activation) {
   for (ITransformationBreakpointHandler breakpoint :
       breakpoints.toArray(new ITransformationBreakpointHandler[breakpoints.size()])) {
     if (breakpoint.isEnabled() && breakpoint.shouldBreak(activation)) {
       for (IDebuggerTargetAgent listener : agents) {
         listener.breakpointHit(breakpoint);
       }
       return true;
     }
   }
   return false;
 }
  @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();
  }
 @Override
 public void afterFiring(Activation<?> activation) {
   for (IDebuggerTargetAgent listener : agents) {
     listener.activationFired(activation);
   }
 }