cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Kirilchuk (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5008) PhaseInterceptorChain insertInterceptor gives wrong ordering
Date Thu, 09 May 2013 16:07:15 GMT

    [ https://issues.apache.org/jira/browse/CXF-5008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13653026#comment-13653026
] 

Vadim Kirilchuk commented on CXF-5008:
--------------------------------------

Got you. I think it would be nice to update javadoc according to your answer, because all
it says is:
bq. A PhaseInterceptorChain orders Interceptors according to the phase they participate in
and also according to the before & after properties on an Interceptor...Within a phase,
interceptors can order themselves. Each PhaseInterceptor has an ID. PhaseInterceptors can
supply a Collection of IDs which they should run before or after, supplying fine grained ordering.

And what's about second issue?

                
> PhaseInterceptorChain insertInterceptor gives wrong ordering
> ------------------------------------------------------------
>
>                 Key: CXF-5008
>                 URL: https://issues.apache.org/jira/browse/CXF-5008
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Vadim Kirilchuk
>            Priority: Minor
>         Attachments: PhaseInterceptorChainTest.patch
>
>
> Hi everyone, 
> I am playing along with PhaseInterceptorChain#insertInterceptor and confused by ordering.
As i understand this code have to order interceptors according to their before/after dependencies.

> I have 5 interceptors with names "0","1","2","3","4"
> "0" must be before "1" and "4"
> "1" must be before "2" but after "0"
> "2" must be before "4" but after "1"
> "3" must be after "1" and "2"
> "4" has no befors or afters
> as you can see the rule is very simple
> n-th element befors can be any from n + 1
> n-th element afters can be any from 0, n
> Now i try to add this interceptors in shuffled order: 4, 2, 0, 1, 3
> Here is what i get in the chain step by step
> 4
> 2, 4
> 2, 0, 4
> 1, 2, 0, 4
> 1, 2, 0, 4, 3
> as you can see constraint for "0" is broken, it must be at the head!
> Also i don't see any checks for case when you met firstBefore and then met lastAfter
which means that your interceptors have conflicting dependencies. Is it OK? 
> Example: interceptor C must be before D but after B, and interceptor B must be after
D
> when you start adding them as D B C you first add D to chain
> D
> then B, and see that it have to be after D
> D B
> then you try to add C and see, that it must be before D but after B
> c D B c
> and no exceptions or something is thrown.
> I am attaching tests as well.
> Please check them and tell me if i just doing something wrong.
> Thanks in advance.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message