cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@verizon.net>
Subject Re: Question about PhaseInterceptorChain class
Date Sun, 27 Jan 2008 20:39:26 GMT
Thanks Freeman and Dan.  I updated the comments.

Glen

Am Samstag, den 26.01.2008, 21:29 -0500 schrieb Daniel Kulp:
> Glen,
> 
> On Saturday 26 January 2008, Glen Mazza wrote:
> > Team, in the org.apache.cxf.phase.PhaseInterceptorChain (PIC) class,
> > the listing of phases are populated in the PIC constructor, shown in
> > lines 131 to 136 here:  http://tinyurl.com/ytxfzk
> >
> > Question: What code is calling this constructor? 
> 
> Almost always, it would be the PhaseChainCache in the same package.   
> Most critical places that use the phase chains cache them as setting up 
> the chain can be expensive (evaluating all the befores/afters, etc....).   
> I think the fault chains aren't right now, but that's mostly because I 
> never got back to updating those. 
> 
> Note: the "cache" is kind of a misnomer.   PhaseChains are not reusable.   
> In the course of processing a message, the chain is modified as certain 
> interceptors will add "tail" interceptors, possibly remove others, 
> etc...  The cache holds a pre-setup phase chain and then uses the copy 
> constructor to create a new one each time.   The copy constructor is 
> much faster as all the before/after stuff, sorting, etc...  is done.   
> 
> > I'd like to see 
> > where the list of phases are coming from.  I am guessing it is from a
> > Spring configuration file, because I can't find the source file making
> > the constructor call.
> 
> The phases themselves are controlled by the PhaseManager, specifically 
> the PhaseManagerImpl in rt-core.  You can actually add phases by 
> grabbing the PhaseManager from the Bus and adding the phases.
> 
> A couple places you can look:
> 
> 1) Line 532 of org.apache.cxf.endpoint.ClientImpl.   That's where the 
> outgoing chain for the client is setup.
> 
> 2) Line 410 of same class is the incoming side
> 
> 3) Line 157 of OutgoingChainInterceptor - sets up the outgoing side on 
> the server
> 
> 4) org.apache.cxf.transport.ChainInitiationObserver - line 68 is the init 
> of chains for the incoming stuff on the server.
> 
> 
> As I said, the faults aren't using the chaches yet.   For example, if you 
> look at org.apache.cxf.interceptor.InFaultChainInitiatorObserver, (and 
> it's superclass) it creates a new chain for each fault.    That could be 
> updated to use the caches.   The outgoing faults on the server side 
> could as well.
> 
> Does that help?
> 


Mime
View raw message