[windup-dev] Phases, after, before

Ondrej Zizka ozizka at redhat.com
Thu Jan 29 10:08:31 EST 2015


Notes:

1) Phase classes could perhaps end with ...Phase
2) Phases should be printed, sorted, before all rules are printed, 
because if a cycle or rule deps error is detected, this message is not 
printed and user doesn't have a hit on what's the right phase to put the 
rule to.
3) I've updated 
https://github.com/windup/windup/wiki/Rules-Rule-Execution-Lifecycle 
with the list of phases, as a temporary info.


Ondra





On 29.1.2015 15:15, Ondrej Zizka wrote:
> In other words:
>
> It is a bit useless to figure out what phase it is in case you know both
> bounds, and find the right phase to fit it in.
> Sometimes the bounds span over multiple phases.
>
> Even if you do not have the upper (execute before) bound, we could just
> set ReportingPhase as the upper bound automatically.
>
> IIUC, the phases now can be used in getBefore() and getAfter().
> Correct me please if I get that incorrectly.
>
> Thanks,
> Ondra
>
>
> On 29.1.2015 15:08, Ondrej Zizka wrote:
>> (Re-sending from my RH account, pls reply to this, thx)
>>
>>
>> On 29.1.2015 15:07, "Ing. Ondřej Žižka" wrote:
>>> Hi all,
>>>
>>> see the code below.
>>>
>>> Originally I thought that getPhase() was removed entirely.
>>> Now I see that we have all of getExecuteAfter(), getExecuteBefore() and
>>> getPhase().
>>>
>>> I suggest that we do NOT set the default phase MigrationRules in case
>>> both getExecuteAfter() and getExecuteBefore() are overriden (return
>>> something).
>>> That will allow users to omit getPhase().
>>> See the code and exception below for motivation.
>>>
>>> WDYT?
>>>
>>> ===============================
>>> public class SkipArchivesRules extends WindupRuleProvider
>>> {
>>>         @Override
>>>         public List<Class<? extends WindupRuleProvider>> getExecuteAfter()
>>>         {
>>>             return asClassList(IdentifyArchivesRules.class,
>>> SkipArchivesLoadConfigRules.class);
>>>         }
>>>
>>>         @Override
>>>         public List<Class<? extends WindupRuleProvider>> getExecuteBefore()
>>>         {
>>>             return asClassList(DecompileArchivesRuleProvider.class);
>>>         }
>>>
>>> java.lang.RuntimeException: Dependency cycles detected: Found dependency
>>> cycle involving: _DEFAULT_.SkipArchivesRules
>>>         Subcycle: _DEFAULT_.SkipArchivesRules
>>>         Subcycle:
>>> org.jboss.windup.rules.apps:rules-java.DecompileArchivesRuleProvider
>>>         Subcycle:
>>> org.jboss.windup.quickstarts:windup-skiparchives.IdentifyArchivesRules
>>>         Subcycle: InitialAnalysis
>>>         Subcycle:
>>> org.jboss.windup.quickstarts:windup-skiparchives.SkipArchivesLoadConfigRules
>>>         Subcycle:
>>> org.jboss.windup.quickstarts:windup-skiparchives.SkipArchivesRules
>>>         Subcycle: MigrationRules
>>>         Subcycle:
>>> org.jboss.windup.rules.apps:rules-java.AnalyzeJavaFilesRuleProvider
>>>
>>> _______________________________________________
>>> windup-dev mailing list
>>> windup-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/windup-dev
>> _______________________________________________
>> windup-dev mailing list
>> windup-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/windup-dev
> _______________________________________________
> windup-dev mailing list
> windup-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/windup-dev



More information about the windup-dev mailing list