On Tue, Aug 25, 2009 at 11:24 PM, Alexis Midon <[email protected]> wrote:

> Hey there,
>
> I'm trying to dynamically skip a phase. Let me explain.
> Let's say I have defined the following phases as InFlow: Transport,
> Security, Dispatch, OperationInPhase. I want to skip the Security phase in
> some cases, in other words I want the phase order to become [Transport,
> Dispatch, OperationInPhase].
>
> I've tried to insert my decision test (skip Security or not?) into the
> method Phase#checkPreconditions of a new Phase subclass, but it wouldn't
> work. Actually if an AxisFault is thrown in Phase#checkPreconditions, all
> the following phases are skipped. Cf. AxisEngine#invoke.
>
> My next idea was to override Phase#invoke, insert my test and eventually
> delegate to the super method implementation. Unfortunately, Phase#invoke is
> marked as final. :(
>
> Then I tried to decorate a Phase in an handler implementation, but this is
> a dead end as well because a Phase instance is required by
> AxisConfigBuilder#getPhase.
>
> At this point, I ran out of ideas. That's why my asking for your help guys.
> I hope you will have a solution for my use case.


What is the problem of the security phase? I think you try to solve the
problem in wrong way.
Although security phase invoked for all the messages, it does not do any
thing if your service has not engaged security.

One trick would be to add a new handler to Transport Phase and increase the
currentHanderIndex value of the message context.

thanks,
Amila.

>
>
> Thanks in advance.
>
> Alexis
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Reply via email to