コード例 #1
0
 private void conflictSetChanged(TransformationDebuggerConflictSet set) {
   nextActivations = Sets.newHashSet(set.getNextActivations());
   conflictingActivations = Sets.newHashSet(set.getConflictingActivations());
   for (IDebuggerTargetAgent listener : agents) {
     listener.conflictSetChanged(nextActivations, conflictingActivations);
   }
 }
コード例 #2
0
 @Override
 public void addedRule(RuleSpecification<?> specification, EventFilter<?> filter) {
   rules.add(new Pair<RuleSpecification<?>, EventFilter<?>>(specification, filter));
   for (IDebuggerTargetAgent listener : agents) {
     listener.addedRule(specification, filter);
   }
 }
コード例 #3
0
    @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;
    }
コード例 #4
0
 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;
     }
   }
 }
コード例 #5
0
 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;
 }
コード例 #6
0
  @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();
  }
コード例 #7
0
 @Override
 public void afterFiring(Activation<?> activation) {
   for (IDebuggerTargetAgent listener : agents) {
     listener.activationFired(activation);
   }
 }