On Monday, May 30, 2011 1:27:15 PM Blue Diamond wrote:
> Hi Sergey,
>
> Thanks for your quick response. This is how I am starting a JAXRS endpoint
> & engaging interceptors:
>
> JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
> factory.setServiceBean(this);
> factory.setAddress(url);
> factory.getInInterceptors().add(new Interceptor1(this));
> factory.getInInterceptors().add(new InInterceptor2(this));
> factory.start();
>
>
> in my InInterceptor1.. after some validation, I do a MyTLS.setObject(obj).
> And in my InInterceptor2, when I do a MyTLS.getObject(), it gives me a
> NULL.(No issues with MyTLS normally).
>
> I can't imagine interceptors are being run each in a seperate thread since
> its a chain mechanism!
There ARE cases where the chain will get paused on one thread and resumed on
another. Processing of one-ways is one scenario if we have to send a 200
back immediately (prior to dispatch ) and free up the transport thread.
Another scenario is in ws-addressing/ws-rm where decoupled responses and acks
need to be sent back on separate channels and such. Normally, it would be
on a thread, but it CAN switch threads.
My suggestion would be to use the message or exchange passed into the
interceptor. message.put("my.data", obj) will store it there and then you
can retrieve it later. If the message flips threads for any reason, the
data would go with it.
Dan
>
> Thanks & Regards,
> Anil
>
> On Mon, May 30, 2011 at 10:03 PM, Sergey Beryozkin
<[email protected]>wrote:
> > Can you describe at what stage you are trying to retrieve a TLS property
> > ? When does the 2nd interceptor run ?
> >
> > thanks, Sergey
> >
> > On Mon, May 30, 2011 at 4:29 PM, Blue Diamond <[email protected]> wrote:
> > > Hi,
> > >
> > > I have a couple of SoapInterceptors engaged to my REST/WS service. In
> > > the first interceptor, I am setting a TLS variable. But I am not able
> > > to get
> >
> > the
> >
> > > TLS variable from inside the second interceptor. Does CXF spawn
> > > multiple threads for interceptors? Why is TLS not working in this
> > > case? What
> >
> > should I
> >
> > > do to make it work?
> > >
> > > Thanks & Regards,
> > > Anil
> >
> > --
> > Sergey Beryozkin
> >
> > Application Integration Division of Talend
> > http://sberyozkin.blogspot.com
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com