Interface RuleLifecycleListener

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void afterExecution​(GraphRewrite event)
      Called immediately after any Rule instances are executed.
      void afterRuleConditionEvaluation​(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule, boolean result)
      Called immediately after execution of the each Rule.
      void afterRuleExecutionFailed​(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule, Throwable failureCause)
      Called immediately after a a Rule has thrown an exception, to indicate a failure of some kind
      void afterRuleOperationsPerformed​(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule)
      Called immediately after Rule operations are performed (Only called if Condition.evaluate(org.ocpsoft.rewrite.event.Rewrite, EvaluationContext) returned true).
      void beforeExecution​(GraphRewrite event)
      Called immediately before any Rule instances are executed.
      boolean beforeRuleEvaluation​(GraphRewrite event, org.ocpsoft.rewrite.config.Rule rule, org.ocpsoft.rewrite.context.EvaluationContext context)
      Called immediately before the given Rule is executed.
      boolean beforeRuleOperationsPerformed​(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule)
      Called immediately before Rule operations are performed (Only called if Condition.evaluate(org.ocpsoft.rewrite.event.Rewrite, EvaluationContext) returned true).
      boolean ruleEvaluationProgress​(GraphRewrite event, String name, int currentPosition, int total, int timeRemainingInSeconds)
      This is optionally called by long-running rules to indicate their current progress and estimated time-remaining.
      default boolean shouldWindupStop()
      Returns directly the information whether Windup execution should stop.
    • Method Detail

      • beforeExecution

        void beforeExecution​(GraphRewrite event)
        Called immediately before any Rule instances are executed.
      • beforeRuleEvaluation

        boolean beforeRuleEvaluation​(GraphRewrite event,
                                     org.ocpsoft.rewrite.config.Rule rule,
                                     org.ocpsoft.rewrite.context.EvaluationContext context)
        Called immediately before the given Rule is executed.
        Returns:
        true if the execution should be stopped, which is typically indicated by an underlying WindupProgressMonitor.
      • ruleEvaluationProgress

        boolean ruleEvaluationProgress​(GraphRewrite event,
                                       String name,
                                       int currentPosition,
                                       int total,
                                       int timeRemainingInSeconds)
        This is optionally called by long-running rules to indicate their current progress and estimated time-remaining.
        Returns:
        true if the execution should be stopped, which is typically indicated by an underlying WindupProgressMonitor.
      • afterRuleConditionEvaluation

        void afterRuleConditionEvaluation​(GraphRewrite event,
                                          org.ocpsoft.rewrite.context.EvaluationContext context,
                                          org.ocpsoft.rewrite.config.Rule rule,
                                          boolean result)
        Called immediately after execution of the each Rule.
      • beforeRuleOperationsPerformed

        boolean beforeRuleOperationsPerformed​(GraphRewrite event,
                                              org.ocpsoft.rewrite.context.EvaluationContext context,
                                              org.ocpsoft.rewrite.config.Rule rule)
        Called immediately before Rule operations are performed (Only called if Condition.evaluate(org.ocpsoft.rewrite.event.Rewrite, EvaluationContext) returned true).
        Returns:
        true if the execution should be stopped, which is typically indicated by an underlying WindupProgressMonitor.
      • afterRuleOperationsPerformed

        void afterRuleOperationsPerformed​(GraphRewrite event,
                                          org.ocpsoft.rewrite.context.EvaluationContext context,
                                          org.ocpsoft.rewrite.config.Rule rule)
        Called immediately after Rule operations are performed (Only called if Condition.evaluate(org.ocpsoft.rewrite.event.Rewrite, EvaluationContext) returned true).
      • afterRuleExecutionFailed

        void afterRuleExecutionFailed​(GraphRewrite event,
                                      org.ocpsoft.rewrite.context.EvaluationContext context,
                                      org.ocpsoft.rewrite.config.Rule rule,
                                      Throwable failureCause)
        Called immediately after a a Rule has thrown an exception, to indicate a failure of some kind
      • afterExecution

        void afterExecution​(GraphRewrite event)
        Called immediately after any Rule instances are executed.
      • shouldWindupStop

        default boolean shouldWindupStop()
        Returns directly the information whether Windup execution should stop. Not all listeners need to return true - just one returning true is a reason to stop execution. Queried by various rule implementations so we can stop as soon as possible.