You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org> on 2008/01/02 04:14:33 UTC

[jira] Created: (AXIS2-3421) An algorithum to determine the phase order

An algorithum to determine the phase order 
-------------------------------------------

                 Key: AXIS2-3421
                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
             Project: Axis 2.0 (Axis2)
          Issue Type: Improvement
          Components: deployment
            Reporter: Amila Chinthaka Suriarachchi


This algorithm users a simplified logical model to determine the phase
order of a given set of phases with phase rules.
Following description is only based on the after and before rules for
simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
as well.
1. This algorithum only works with before rules. i.e after is also consider
as a before rule.
eg. if <A before="B" after="C"/>
we assume this equals to
    <A before="B"/> and <C before="A"/>

2. A seperate list called before phases list is used to keep the before phases
of a given phase. This detail is used to validate a rule and relocate a phase.
eg. for above case here is the before lists
<C before="A,B"/>
<A before="B"/>
<B before=""/>

before list of any phase is clearly a subset of phases below it.

One phase by one phase added to the final phase order list. At any time this
phase order list contains a valid phase order according to the known phase rules.
So all phases has their before list as specified by the rules.

PsudoCode for adding a Phase (A).

// phase A only have a before rule. if original rule has an after rule then
// we add another rule using the first law

if A already exists
    // if a exists then validate it with before and after phases
    if before phase rule given (B)
        if before phase exists
            // if the before phase already in the system, we have to add this rule to the
            // system i.e update the before lists
            Add B's phases to A and all the other phases having A in their before list.
            Relocate B if it already not after A (see the relocate procedure below)
        else
            // before phase not in the system
            Add before phase as the last phase
            Add before phase to A and all the other phases having A in their before list.
else
    // i.e if A does not exists in the system
    if before phase rule given (B)
        if before phase exists
            Place A just before the B
            Add all B's phases to the As' before list.
        else
            // if there is no before phase
            Add the before phase to end of the list
            Place A just before B
            Add all B's phases to the As' before list
    else
      //i.e no before rule is given. then we can safely place this at the end
      Add A to end of phase order

 So this method would keep the list in the with the orignal condition and hence
 we can keep on adding phases

 Relocate Algorithum
 Relocate Phase A

 Go through the phase order list until find a phase belongs to before list.
 // this means we have to insert this phase at lest before this point (i).
 // As mentioned earlier before list of a phase must be a subset of phase below it
 // so all the phases below this point (i) can not have A as a before list phase
 Check whether below phase contain A as a before list phase
    if exits throw an exception
    else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3421) An algorithum to determine the phase order

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi updated AXIS2-3421:
------------------------------------------------

    Attachment: dynamic_phase2.tar

sample implementation with phaseFirst and phaseLast rules of above algorithum

> An algorithum to determine the phase order 
> -------------------------------------------
>
>                 Key: AXIS2-3421
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: deployment
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: dynamic_phase2.tar
>
>
> This algorithm users a simplified logical model to determine the phase
> order of a given set of phases with phase rules.
> Following description is only based on the after and before rules for
> simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
> as well.
> 1. This algorithum only works with before rules. i.e after is also consider
> as a before rule.
> eg. if <A before="B" after="C"/>
> we assume this equals to
>     <A before="B"/> and <C before="A"/>
> 2. A seperate list called before phases list is used to keep the before phases
> of a given phase. This detail is used to validate a rule and relocate a phase.
> eg. for above case here is the before lists
> <C before="A,B"/>
> <A before="B"/>
> <B before=""/>
> before list of any phase is clearly a subset of phases below it.
> One phase by one phase added to the final phase order list. At any time this
> phase order list contains a valid phase order according to the known phase rules.
> So all phases has their before list as specified by the rules.
> PsudoCode for adding a Phase (A).
> // phase A only have a before rule. if original rule has an after rule then
> // we add another rule using the first law
> if A already exists
>     // if a exists then validate it with before and after phases
>     if before phase rule given (B)
>         if before phase exists
>             // if the before phase already in the system, we have to add this rule to the
>             // system i.e update the before lists
>             Add B's phases to A and all the other phases having A in their before list.
>             Relocate B if it already not after A (see the relocate procedure below)
>         else
>             // before phase not in the system
>             Add before phase as the last phase
>             Add before phase to A and all the other phases having A in their before list.
> else
>     // i.e if A does not exists in the system
>     if before phase rule given (B)
>         if before phase exists
>             Place A just before the B
>             Add all B's phases to the As' before list.
>         else
>             // if there is no before phase
>             Add the before phase to end of the list
>             Place A just before B
>             Add all B's phases to the As' before list
>     else
>       //i.e no before rule is given. then we can safely place this at the end
>       Add A to end of phase order
>  So this method would keep the list in the with the orignal condition and hence
>  we can keep on adding phases
>  Relocate Algorithum
>  Relocate Phase A
>  Go through the phase order list until find a phase belongs to before list.
>  // this means we have to insert this phase at lest before this point (i).
>  // As mentioned earlier before list of a phase must be a subset of phase below it
>  // so all the phases below this point (i) can not have A as a before list phase
>  Check whether below phase contain A as a before list phase
>     if exits throw an exception
>     else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Reopened: (AXIS2-3421) An algorithum to determine the phase order

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas reopened AXIS2-3421:
-------------------------------------


> An algorithum to determine the phase order 
> -------------------------------------------
>
>                 Key: AXIS2-3421
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: deployment
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: dynamic_phase2.tar
>
>
> This algorithm users a simplified logical model to determine the phase
> order of a given set of phases with phase rules.
> Following description is only based on the after and before rules for
> simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
> as well.
> 1. This algorithum only works with before rules. i.e after is also consider
> as a before rule.
> eg. if <A before="B" after="C"/>
> we assume this equals to
>     <A before="B"/> and <C before="A"/>
> 2. A seperate list called before phases list is used to keep the before phases
> of a given phase. This detail is used to validate a rule and relocate a phase.
> eg. for above case here is the before lists
> <C before="A,B"/>
> <A before="B"/>
> <B before=""/>
> before list of any phase is clearly a subset of phases below it.
> One phase by one phase added to the final phase order list. At any time this
> phase order list contains a valid phase order according to the known phase rules.
> So all phases has their before list as specified by the rules.
> PsudoCode for adding a Phase (A).
> // phase A only have a before rule. if original rule has an after rule then
> // we add another rule using the first law
> if A already exists
>     // if a exists then validate it with before and after phases
>     if before phase rule given (B)
>         if before phase exists
>             // if the before phase already in the system, we have to add this rule to the
>             // system i.e update the before lists
>             Add B's phases to A and all the other phases having A in their before list.
>             Relocate B if it already not after A (see the relocate procedure below)
>         else
>             // before phase not in the system
>             Add before phase as the last phase
>             Add before phase to A and all the other phases having A in their before list.
> else
>     // i.e if A does not exists in the system
>     if before phase rule given (B)
>         if before phase exists
>             Place A just before the B
>             Add all B's phases to the As' before list.
>         else
>             // if there is no before phase
>             Add the before phase to end of the list
>             Place A just before B
>             Add all B's phases to the As' before list
>     else
>       //i.e no before rule is given. then we can safely place this at the end
>       Add A to end of phase order
>  So this method would keep the list in the with the orignal condition and hence
>  we can keep on adding phases
>  Relocate Algorithum
>  Relocate Phase A
>  Go through the phase order list until find a phase belongs to before list.
>  // this means we have to insert this phase at lest before this point (i).
>  // As mentioned earlier before list of a phase must be a subset of phase below it
>  // so all the phases below this point (i) can not have A as a before list phase
>  Check whether below phase contain A as a before list phase
>     if exits throw an exception
>     else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3421) An algorithum to determine the phase order

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555485#action_12555485 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3421:
-----------------------------------------------------

These are the features of this algorithm.
1. People can write phase rules declaratively without thinking any order. 
i.e to wire <A before="B" after="C"> there is no need to declare B and C before it.

2. This validate the phase rules.
i.e this will give you a correct possible phase order if and only if there exists one. other wise gives an exception. this is very important otherwise system may malfunction without users knowledge. On the other hand if there is a possible solution it will give it.

if you have those two features in your algorithm that is fine.

just take this example
<A>
<B>

here there are no rules for A and B so both 
A,B and B,A is fine when we consider only these two rules.

now think we have 
A,B and there is a rule saying 
<A after="B">

so after adding this rule it should be 
B,A

So how you are going to resolve this without repositioning? what happens for this type of
scenario in your algorithm?

I'll have a look at that.

> An algorithum to determine the phase order 
> -------------------------------------------
>
>                 Key: AXIS2-3421
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: deployment
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: dynamic_phase2.tar
>
>
> This algorithm users a simplified logical model to determine the phase
> order of a given set of phases with phase rules.
> Following description is only based on the after and before rules for
> simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
> as well.
> 1. This algorithum only works with before rules. i.e after is also consider
> as a before rule.
> eg. if <A before="B" after="C"/>
> we assume this equals to
>     <A before="B"/> and <C before="A"/>
> 2. A seperate list called before phases list is used to keep the before phases
> of a given phase. This detail is used to validate a rule and relocate a phase.
> eg. for above case here is the before lists
> <C before="A,B"/>
> <A before="B"/>
> <B before=""/>
> before list of any phase is clearly a subset of phases below it.
> One phase by one phase added to the final phase order list. At any time this
> phase order list contains a valid phase order according to the known phase rules.
> So all phases has their before list as specified by the rules.
> PsudoCode for adding a Phase (A).
> // phase A only have a before rule. if original rule has an after rule then
> // we add another rule using the first law
> if A already exists
>     // if a exists then validate it with before and after phases
>     if before phase rule given (B)
>         if before phase exists
>             // if the before phase already in the system, we have to add this rule to the
>             // system i.e update the before lists
>             Add B's phases to A and all the other phases having A in their before list.
>             Relocate B if it already not after A (see the relocate procedure below)
>         else
>             // before phase not in the system
>             Add before phase as the last phase
>             Add before phase to A and all the other phases having A in their before list.
> else
>     // i.e if A does not exists in the system
>     if before phase rule given (B)
>         if before phase exists
>             Place A just before the B
>             Add all B's phases to the As' before list.
>         else
>             // if there is no before phase
>             Add the before phase to end of the list
>             Place A just before B
>             Add all B's phases to the As' before list
>     else
>       //i.e no before rule is given. then we can safely place this at the end
>       Add A to end of phase order
>  So this method would keep the list in the with the orignal condition and hence
>  we can keep on adding phases
>  Relocate Algorithum
>  Relocate Phase A
>  Go through the phase order list until find a phase belongs to before list.
>  // this means we have to insert this phase at lest before this point (i).
>  // As mentioned earlier before list of a phase must be a subset of phase below it
>  // so all the phases below this point (i) can not have A as a before list phase
>  Check whether below phase contain A as a before list phase
>     if exits throw an exception
>     else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3421) An algorithum to determine the phase order

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576690#action_12576690 ] 

Davanum Srinivas commented on AXIS2-3421:
-----------------------------------------

Amila,

Please create an issue for the last comment, i think we should let things be for 1.4

thanks,
dims

> An algorithum to determine the phase order 
> -------------------------------------------
>
>                 Key: AXIS2-3421
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: deployment
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: dynamic_phase2.tar
>
>
> This algorithm users a simplified logical model to determine the phase
> order of a given set of phases with phase rules.
> Following description is only based on the after and before rules for
> simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
> as well.
> 1. This algorithum only works with before rules. i.e after is also consider
> as a before rule.
> eg. if <A before="B" after="C"/>
> we assume this equals to
>     <A before="B"/> and <C before="A"/>
> 2. A seperate list called before phases list is used to keep the before phases
> of a given phase. This detail is used to validate a rule and relocate a phase.
> eg. for above case here is the before lists
> <C before="A,B"/>
> <A before="B"/>
> <B before=""/>
> before list of any phase is clearly a subset of phases below it.
> One phase by one phase added to the final phase order list. At any time this
> phase order list contains a valid phase order according to the known phase rules.
> So all phases has their before list as specified by the rules.
> PsudoCode for adding a Phase (A).
> // phase A only have a before rule. if original rule has an after rule then
> // we add another rule using the first law
> if A already exists
>     // if a exists then validate it with before and after phases
>     if before phase rule given (B)
>         if before phase exists
>             // if the before phase already in the system, we have to add this rule to the
>             // system i.e update the before lists
>             Add B's phases to A and all the other phases having A in their before list.
>             Relocate B if it already not after A (see the relocate procedure below)
>         else
>             // before phase not in the system
>             Add before phase as the last phase
>             Add before phase to A and all the other phases having A in their before list.
> else
>     // i.e if A does not exists in the system
>     if before phase rule given (B)
>         if before phase exists
>             Place A just before the B
>             Add all B's phases to the As' before list.
>         else
>             // if there is no before phase
>             Add the before phase to end of the list
>             Place A just before B
>             Add all B's phases to the As' before list
>     else
>       //i.e no before rule is given. then we can safely place this at the end
>       Add A to end of phase order
>  So this method would keep the list in the with the orignal condition and hence
>  we can keep on adding phases
>  Relocate Algorithum
>  Relocate Phase A
>  Go through the phase order list until find a phase belongs to before list.
>  // this means we have to insert this phase at lest before this point (i).
>  // As mentioned earlier before list of a phase must be a subset of phase below it
>  // so all the phases below this point (i) can not have A as a before list phase
>  Check whether below phase contain A as a before list phase
>     if exits throw an exception
>     else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3421) An algorithum to determine the phase order

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555504#action_12555504 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3421:
-----------------------------------------------------

I went through your algorithm and as you have told It uses the same basic concepts. Instead of using relocation for each and every phase you have rebuild all. getMinIndex apprently use the same logic as relocation function in my implementation.
I saw these lines

// If something by this name already exists, ensure it's compatible
 if (previous.isFirst() != deployable.isFirst()) {
                throw new Exception("Can't deploy '" + name + "', values for first don't match!");
            }
            if (previous.isLast() != deployable.isLast()) {
                throw new Exception("Can't deploy '" + name + "', values for last don't match!");
            }

is this means we are going to throw an exception for 
<A>
<A phaseFirst=true>

I think it should not be.


> An algorithum to determine the phase order 
> -------------------------------------------
>
>                 Key: AXIS2-3421
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: deployment
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: dynamic_phase2.tar
>
>
> This algorithm users a simplified logical model to determine the phase
> order of a given set of phases with phase rules.
> Following description is only based on the after and before rules for
> simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
> as well.
> 1. This algorithum only works with before rules. i.e after is also consider
> as a before rule.
> eg. if <A before="B" after="C"/>
> we assume this equals to
>     <A before="B"/> and <C before="A"/>
> 2. A seperate list called before phases list is used to keep the before phases
> of a given phase. This detail is used to validate a rule and relocate a phase.
> eg. for above case here is the before lists
> <C before="A,B"/>
> <A before="B"/>
> <B before=""/>
> before list of any phase is clearly a subset of phases below it.
> One phase by one phase added to the final phase order list. At any time this
> phase order list contains a valid phase order according to the known phase rules.
> So all phases has their before list as specified by the rules.
> PsudoCode for adding a Phase (A).
> // phase A only have a before rule. if original rule has an after rule then
> // we add another rule using the first law
> if A already exists
>     // if a exists then validate it with before and after phases
>     if before phase rule given (B)
>         if before phase exists
>             // if the before phase already in the system, we have to add this rule to the
>             // system i.e update the before lists
>             Add B's phases to A and all the other phases having A in their before list.
>             Relocate B if it already not after A (see the relocate procedure below)
>         else
>             // before phase not in the system
>             Add before phase as the last phase
>             Add before phase to A and all the other phases having A in their before list.
> else
>     // i.e if A does not exists in the system
>     if before phase rule given (B)
>         if before phase exists
>             Place A just before the B
>             Add all B's phases to the As' before list.
>         else
>             // if there is no before phase
>             Add the before phase to end of the list
>             Place A just before B
>             Add all B's phases to the As' before list
>     else
>       //i.e no before rule is given. then we can safely place this at the end
>       Add A to end of phase order
>  So this method would keep the list in the with the orignal condition and hence
>  we can keep on adding phases
>  Relocate Algorithum
>  Relocate Phase A
>  Go through the phase order list until find a phase belongs to before list.
>  // this means we have to insert this phase at lest before this point (i).
>  // As mentioned earlier before list of a phase must be a subset of phase below it
>  // so all the phases below this point (i) can not have A as a before list phase
>  Check whether below phase contain A as a before list phase
>     if exits throw an exception
>     else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3421) An algorithum to determine the phase order

Posted by "Glen Daniels (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555363#action_12555363 ] 

Glen Daniels commented on AXIS2-3421:
-------------------------------------

Hi Amila - this is very close to what I did in DeployableChain (although I think my algorithm might be a little simpler as it doesn't involve repositioning, just insertion in reverse order).  Take a look?

> An algorithum to determine the phase order 
> -------------------------------------------
>
>                 Key: AXIS2-3421
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: deployment
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: dynamic_phase2.tar
>
>
> This algorithm users a simplified logical model to determine the phase
> order of a given set of phases with phase rules.
> Following description is only based on the after and before rules for
> simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
> as well.
> 1. This algorithum only works with before rules. i.e after is also consider
> as a before rule.
> eg. if <A before="B" after="C"/>
> we assume this equals to
>     <A before="B"/> and <C before="A"/>
> 2. A seperate list called before phases list is used to keep the before phases
> of a given phase. This detail is used to validate a rule and relocate a phase.
> eg. for above case here is the before lists
> <C before="A,B"/>
> <A before="B"/>
> <B before=""/>
> before list of any phase is clearly a subset of phases below it.
> One phase by one phase added to the final phase order list. At any time this
> phase order list contains a valid phase order according to the known phase rules.
> So all phases has their before list as specified by the rules.
> PsudoCode for adding a Phase (A).
> // phase A only have a before rule. if original rule has an after rule then
> // we add another rule using the first law
> if A already exists
>     // if a exists then validate it with before and after phases
>     if before phase rule given (B)
>         if before phase exists
>             // if the before phase already in the system, we have to add this rule to the
>             // system i.e update the before lists
>             Add B's phases to A and all the other phases having A in their before list.
>             Relocate B if it already not after A (see the relocate procedure below)
>         else
>             // before phase not in the system
>             Add before phase as the last phase
>             Add before phase to A and all the other phases having A in their before list.
> else
>     // i.e if A does not exists in the system
>     if before phase rule given (B)
>         if before phase exists
>             Place A just before the B
>             Add all B's phases to the As' before list.
>         else
>             // if there is no before phase
>             Add the before phase to end of the list
>             Place A just before B
>             Add all B's phases to the As' before list
>     else
>       //i.e no before rule is given. then we can safely place this at the end
>       Add A to end of phase order
>  So this method would keep the list in the with the orignal condition and hence
>  we can keep on adding phases
>  Relocate Algorithum
>  Relocate Phase A
>  Go through the phase order list until find a phase belongs to before list.
>  // this means we have to insert this phase at lest before this point (i).
>  // As mentioned earlier before list of a phase must be a subset of phase below it
>  // so all the phases below this point (i) can not have A as a before list phase
>  Check whether below phase contain A as a before list phase
>     if exits throw an exception
>     else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3421) An algorithum to determine the phase order

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576705#action_12576705 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3421:
-----------------------------------------------------

hi dims,

Since this is only an improvement I think it is ok to keep this as an open issue. Anyway I don't have an idea to fixed this for axis2 1.4. 

If I open another issue for this that would loose the whole information. So if someone try to do it future it is advantages to keep it like this.

thanks,
Amila.

> An algorithum to determine the phase order 
> -------------------------------------------
>
>                 Key: AXIS2-3421
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: deployment
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: dynamic_phase2.tar
>
>
> This algorithm users a simplified logical model to determine the phase
> order of a given set of phases with phase rules.
> Following description is only based on the after and before rules for
> simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
> as well.
> 1. This algorithum only works with before rules. i.e after is also consider
> as a before rule.
> eg. if <A before="B" after="C"/>
> we assume this equals to
>     <A before="B"/> and <C before="A"/>
> 2. A seperate list called before phases list is used to keep the before phases
> of a given phase. This detail is used to validate a rule and relocate a phase.
> eg. for above case here is the before lists
> <C before="A,B"/>
> <A before="B"/>
> <B before=""/>
> before list of any phase is clearly a subset of phases below it.
> One phase by one phase added to the final phase order list. At any time this
> phase order list contains a valid phase order according to the known phase rules.
> So all phases has their before list as specified by the rules.
> PsudoCode for adding a Phase (A).
> // phase A only have a before rule. if original rule has an after rule then
> // we add another rule using the first law
> if A already exists
>     // if a exists then validate it with before and after phases
>     if before phase rule given (B)
>         if before phase exists
>             // if the before phase already in the system, we have to add this rule to the
>             // system i.e update the before lists
>             Add B's phases to A and all the other phases having A in their before list.
>             Relocate B if it already not after A (see the relocate procedure below)
>         else
>             // before phase not in the system
>             Add before phase as the last phase
>             Add before phase to A and all the other phases having A in their before list.
> else
>     // i.e if A does not exists in the system
>     if before phase rule given (B)
>         if before phase exists
>             Place A just before the B
>             Add all B's phases to the As' before list.
>         else
>             // if there is no before phase
>             Add the before phase to end of the list
>             Place A just before B
>             Add all B's phases to the As' before list
>     else
>       //i.e no before rule is given. then we can safely place this at the end
>       Add A to end of phase order
>  So this method would keep the list in the with the orignal condition and hence
>  we can keep on adding phases
>  Relocate Algorithum
>  Relocate Phase A
>  Go through the phase order list until find a phase belongs to before list.
>  // this means we have to insert this phase at lest before this point (i).
>  // As mentioned earlier before list of a phase must be a subset of phase below it
>  // so all the phases below this point (i) can not have A as a before list phase
>  Check whether below phase contain A as a before list phase
>     if exits throw an exception
>     else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-3421) An algorithum to determine the phase order

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas resolved AXIS2-3421.
-------------------------------------

    Resolution: Won't Fix

> An algorithum to determine the phase order 
> -------------------------------------------
>
>                 Key: AXIS2-3421
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3421
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: deployment
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: dynamic_phase2.tar
>
>
> This algorithm users a simplified logical model to determine the phase
> order of a given set of phases with phase rules.
> Following description is only based on the after and before rules for
> simplicity. Sample shows how it can integrate with phaseFirst and phaseLast rules
> as well.
> 1. This algorithum only works with before rules. i.e after is also consider
> as a before rule.
> eg. if <A before="B" after="C"/>
> we assume this equals to
>     <A before="B"/> and <C before="A"/>
> 2. A seperate list called before phases list is used to keep the before phases
> of a given phase. This detail is used to validate a rule and relocate a phase.
> eg. for above case here is the before lists
> <C before="A,B"/>
> <A before="B"/>
> <B before=""/>
> before list of any phase is clearly a subset of phases below it.
> One phase by one phase added to the final phase order list. At any time this
> phase order list contains a valid phase order according to the known phase rules.
> So all phases has their before list as specified by the rules.
> PsudoCode for adding a Phase (A).
> // phase A only have a before rule. if original rule has an after rule then
> // we add another rule using the first law
> if A already exists
>     // if a exists then validate it with before and after phases
>     if before phase rule given (B)
>         if before phase exists
>             // if the before phase already in the system, we have to add this rule to the
>             // system i.e update the before lists
>             Add B's phases to A and all the other phases having A in their before list.
>             Relocate B if it already not after A (see the relocate procedure below)
>         else
>             // before phase not in the system
>             Add before phase as the last phase
>             Add before phase to A and all the other phases having A in their before list.
> else
>     // i.e if A does not exists in the system
>     if before phase rule given (B)
>         if before phase exists
>             Place A just before the B
>             Add all B's phases to the As' before list.
>         else
>             // if there is no before phase
>             Add the before phase to end of the list
>             Place A just before B
>             Add all B's phases to the As' before list
>     else
>       //i.e no before rule is given. then we can safely place this at the end
>       Add A to end of phase order
>  So this method would keep the list in the with the orignal condition and hence
>  we can keep on adding phases
>  Relocate Algorithum
>  Relocate Phase A
>  Go through the phase order list until find a phase belongs to before list.
>  // this means we have to insert this phase at lest before this point (i).
>  // As mentioned earlier before list of a phase must be a subset of phase below it
>  // so all the phases below this point (i) can not have A as a before list phase
>  Check whether below phase contain A as a before list phase
>     if exits throw an exception
>     else insert A at the i th position.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org