Package org.jboss.windup.config
Class AbstractRuleLifecycleListener
- java.lang.Object
-
- org.jboss.windup.config.AbstractRuleLifecycleListener
-
- All Implemented Interfaces:
RuleLifecycleListener
- Direct Known Subclasses:
ProjectTraversalCache
public abstract class AbstractRuleLifecycleListener extends Object implements RuleLifecycleListener
This provides a set of default (empty) methods that make it easy to implementRuleLifecycleListeners that only need to override a subset of the available methods.- Author:
- Jesse Sightler, Ondrej Zizka
-
-
Constructor Summary
Constructors Constructor Description AbstractRuleLifecycleListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterExecution(GraphRewrite event)Called immediately after anyRuleinstances are executed.voidafterRuleConditionEvaluation(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule, boolean result)Called immediately after execution of the eachRule.voidafterRuleExecutionFailed(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule, Throwable failureCause)Called immediately after a aRulehas thrown an exception, to indicate a failure of some kindvoidafterRuleOperationsPerformed(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule)Called immediately afterRuleoperations are performed (Only called ifCondition.evaluate(org.ocpsoft.rewrite.event.Rewrite, EvaluationContext)returnedtrue).voidbeforeExecution(GraphRewrite event)Called immediately before anyRuleinstances are executed.booleanbeforeRuleEvaluation(GraphRewrite event, org.ocpsoft.rewrite.config.Rule rule, org.ocpsoft.rewrite.context.EvaluationContext context)Called immediately before the givenRuleis executed.booleanbeforeRuleOperationsPerformed(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule)Called immediately beforeRuleoperations are performed (Only called ifCondition.evaluate(org.ocpsoft.rewrite.event.Rewrite, EvaluationContext)returnedtrue).booleanruleEvaluationProgress(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.booleanshouldWindupStop()Returns directly the information whether Windup execution should stop.
-
-
-
Method Detail
-
beforeExecution
public void beforeExecution(GraphRewrite event)
Description copied from interface:RuleLifecycleListenerCalled immediately before anyRuleinstances are executed.- Specified by:
beforeExecutionin interfaceRuleLifecycleListener
-
beforeRuleEvaluation
public boolean beforeRuleEvaluation(GraphRewrite event, org.ocpsoft.rewrite.config.Rule rule, org.ocpsoft.rewrite.context.EvaluationContext context)
Description copied from interface:RuleLifecycleListenerCalled immediately before the givenRuleis executed.- Specified by:
beforeRuleEvaluationin interfaceRuleLifecycleListener- Returns:
- true if the execution should be stopped, which is typically indicated by an underlying
WindupProgressMonitor.
-
ruleEvaluationProgress
public boolean ruleEvaluationProgress(GraphRewrite event, String name, int currentPosition, int total, int timeRemainingInSeconds)
Description copied from interface:RuleLifecycleListenerThis is optionally called by long-running rules to indicate their current progress and estimated time-remaining.- Specified by:
ruleEvaluationProgressin interfaceRuleLifecycleListener- Returns:
- true if the execution should be stopped, which is typically indicated by an underlying
WindupProgressMonitor.
-
afterRuleConditionEvaluation
public void afterRuleConditionEvaluation(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule, boolean result)
Description copied from interface:RuleLifecycleListenerCalled immediately after execution of the eachRule.- Specified by:
afterRuleConditionEvaluationin interfaceRuleLifecycleListener
-
beforeRuleOperationsPerformed
public boolean beforeRuleOperationsPerformed(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule)
Description copied from interface:RuleLifecycleListenerCalled immediately beforeRuleoperations are performed (Only called ifCondition.evaluate(org.ocpsoft.rewrite.event.Rewrite, EvaluationContext)returnedtrue).- Specified by:
beforeRuleOperationsPerformedin interfaceRuleLifecycleListener- Returns:
- true if the execution should be stopped, which is typically indicated by an underlying
WindupProgressMonitor.
-
afterRuleOperationsPerformed
public void afterRuleOperationsPerformed(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule)
Description copied from interface:RuleLifecycleListenerCalled immediately afterRuleoperations are performed (Only called ifCondition.evaluate(org.ocpsoft.rewrite.event.Rewrite, EvaluationContext)returnedtrue).- Specified by:
afterRuleOperationsPerformedin interfaceRuleLifecycleListener
-
afterRuleExecutionFailed
public void afterRuleExecutionFailed(GraphRewrite event, org.ocpsoft.rewrite.context.EvaluationContext context, org.ocpsoft.rewrite.config.Rule rule, Throwable failureCause)
Description copied from interface:RuleLifecycleListenerCalled immediately after a aRulehas thrown an exception, to indicate a failure of some kind- Specified by:
afterRuleExecutionFailedin interfaceRuleLifecycleListener
-
afterExecution
public void afterExecution(GraphRewrite event)
Description copied from interface:RuleLifecycleListenerCalled immediately after anyRuleinstances are executed.- Specified by:
afterExecutionin interfaceRuleLifecycleListener
-
shouldWindupStop
public boolean shouldWindupStop()
Description copied from interface:RuleLifecycleListenerReturns 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.- Specified by:
shouldWindupStopin interfaceRuleLifecycleListener
-
-