You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "dattu.1729" <da...@gmail.com> on 2012/06/19 14:15:26 UTC

DOSGI Session sharing

Hi,

How to share Http session between two CXF / REST bundles? 
I have two bundles, lets says B1 and B2. Both the bundles exporting REST
service. In B1 rest service, created a session. But it is not accessible in
Bundle B2. looks like SecurityDelegatingHttpContext (HttpContext) is
creating per Bundle. (I think every bundle creating CXFServlet instance) Is
there any why I can pass same HttpContext in all rest services? or any other
inputs ?


Thanks
Dattu

-----
Thanks
Dattu
--
View this message in context: http://cxf.547215.n5.nabble.com/DOSGI-Session-sharing-tp5709988.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: DOSGI Session sharing

Posted by Sergey Beryozkin <sb...@gmail.com>.
I've opened an improvement request for this issue be tracked:

https://issues.apache.org/jira/browse/DOSGI-140

Not sure yet how easy/feasible that would be but hope it will be 
possible :-)

Cheers, Sergey

On 17/08/12 12:08, Sergey Beryozkin wrote:
> Hi
>
> On 19/06/12 13:15, dattu.1729 wrote:
>> Hi,
>>
>> How to share Http session between two CXF / REST bundles?
>> I have two bundles, lets says B1 and B2. Both the bundles exporting REST
>> service. In B1 rest service, created a session. But it is not
>> accessible in
>> Bundle B2. looks like SecurityDelegatingHttpContext (HttpContext) is
>> creating per Bundle. (I think every bundle creating CXFServlet
>> instance) Is
>> there any why I can pass same HttpContext in all rest services? or any
>> other
>> inputs ?
>>
>
> I think at this stage the best way to manage sessions with multiple
> bundles is to use JAX-RS facilities, for example, use JAX-RS Response to
> set "Set-Cookie" and then use injected HttpHeaders context to get the
> list of incoming Cookie headers - it's a bit more involved but also
> provides for more flexibility.
>
> One option I'd like to try is to support for multiple bundles sharing
> the same HTTP context with relative rs addresses.
>
> HTTP Context + relative RS or WS address already works on the trunk, but
> having two separate bundles using the same HTTP context does not yet -
> I'm going to look into supporting this mode next
>
> Sergey
>
>>
>> Thanks
>> Dattu
>>
>> -----
>> Thanks
>> Dattu
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/DOSGI-Session-sharing-tp5709988.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: DOSGI Session sharing

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On 19/06/12 13:15, dattu.1729 wrote:
> Hi,
>
> How to share Http session between two CXF / REST bundles?
> I have two bundles, lets says B1 and B2. Both the bundles exporting REST
> service. In B1 rest service, created a session. But it is not accessible in
> Bundle B2. looks like SecurityDelegatingHttpContext (HttpContext) is
> creating per Bundle. (I think every bundle creating CXFServlet instance) Is
> there any why I can pass same HttpContext in all rest services? or any other
> inputs ?
>

I think at this stage the best way to manage sessions with multiple 
bundles is to use JAX-RS facilities, for example, use JAX-RS Response to 
set "Set-Cookie" and then use injected HttpHeaders context to get the 
list of incoming Cookie headers - it's a bit more involved but also 
provides for more flexibility.

One option I'd like to try is to support for multiple bundles sharing 
the same HTTP context with relative rs addresses.

HTTP Context + relative RS or WS address already works on the trunk, but 
having two separate bundles using the same HTTP context does not yet - 
I'm going to look into supporting this mode next

Sergey

>
> Thanks
> Dattu
>
> -----
> Thanks
> Dattu
> --
> View this message in context: http://cxf.547215.n5.nabble.com/DOSGI-Session-sharing-tp5709988.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com