cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Easy to Answer REST Interceptor Query
Date Mon, 03 Nov 2008 17:48:56 GMT

Definitely sounds like the JAXRSInInterceptor needs to be moved a bit.

Actually, I'm wondering if it's possible to split it up into a couple smaller 
interceptors that can be distributed into the phases a bit better to make it 
closer to the way the normal processing works?   Do some work in one phase, 
allow users to throw some interceptors in, do some more work, etc...    That 
should definitely make it more flexible, but I'm not sure how hard it would 
be to do.


Dan



On Monday 03 November 2008 7:36:18 am Sergey Beryozkin wrote:
> Hi
>
> > Thanks for answering Gabo,
> >
> > I have noticed that the interceptors are fired for a web service as my
> > services are set up as both web services and rest services. So I'm
> > assuming there is nothing wrong with either the listener itself or the
> > phase that I'm using.
> >
> > Does anyone know how I can tell what Interceptors are in the chain for
> > the REST service ?
>
> There're only currently only two intereceptors in the input chain for
> (JAXRS) Restfuls service, the JAXRSInInterceptor and
> ServiceInvokerInterceptor.
>
> Now, JAXRSInInterceptor is invoked at the very early stage (PRE_STREAM),
> this stage was there from this interceptor's inception so I've never payed
> any attention to it - and I reckon this is the reason you're not seeing
> your own CXF interceptor being invoked. I think I may need to put
> JAXRSInInterceptor to some later stage, such that some custom interceptors
> can be added before and after the the JAXRSInInterceptor has been invoked.
> here're we're talking about the 'classical' CXF interceptors which use
> phases. Would you like your interceptor be invoked before or after
> JAXRSInInterceptor has been invoked ? What stage you're using ? Also, can
> you elaborate a bit more on how you specify interceptors using annotations
> ?
>
>
> If you're ok with your interceptor be invoked before JAXRSInInterceptor
> then you might want to consider using CXF JAX-RS input filters which 
> JAXRSInInterceptor invokes upon them *before* proceeding with handling the
> actual request.
>
> Cheers, Sergey
>
> > Thanks
> >
> > Gabo Manuel wrote:
> >> Hi,
> >>
> >>> Here's a copy of my beans.xml, I configure the interceptors via
> >>> annotations
> >>
> >> I haven't really tried adding interceptors via annotations. You might
> >> want to look up (http://cwiki.apache.org/CXF20DOC/interceptors.html). I
> >> am not sure if in addition to the annotations, you have to add the
> >> interceptor to some interceptor provider as well.
> >>
> >> Also, afaik the phase tells when the interceptor is meant to be given a
> >> chance/shot at the message. INVOKE phase means that the interceptor will
> >> be given the message context before/during method invocation. The link
> >> above lists down when each phase occurs.
> >>
> >> Others?
> >>
> >> Gabo
> >
> > --
> > View this message in context:
> > http://www.nabble.com/Easy-to-Answer-REST-Interceptor-Query-tp20242642p20
> >243179.html Sent from the cxf-user mailing list archive at Nabble.com.



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message