On Wed, May 22, 2013 at 9:37 PM, Afkham Azeez <[email protected]> wrote:

>
>
> On Thu, May 23, 2013 at 4:05 AM, Shariq Muhammed <[email protected]> wrote:
>
>> On Sun, May 19, 2013 at 8:46 PM, Afkham Azeez <[email protected]> wrote:
>>
>>>
>>>
>>> On Mon, May 20, 2013 at 8:04 AM, Supun Malinga <[email protected]> wrote:
>>>
>>>> Hi Guys,
>>>>
>>>> For C5 I think we need to permanently fix the CC related issues. This
>>>> includes both the API related issues we have and the user level issues that
>>>> pops up time to time like this. Please make sure we achieve that.
>>>>
>>>
>>> This can't wait until C5. It has to be fixed ASAP.
>>>
>>
>> Yup true, from what I have seen at time ThreadLocal CC works as expected
>> and other times CC based on MessageContext seems to be the right way.
>> Having toiled with the CC API from time to time, I still am not always
>> quite sure when to use what or if its the correct/expected behavior etc .!
>>
>> During the last Stratos release Sinthuja did some changes to give
>> priority to ThreadLocal CC (after discussing with the team of course) but
>> we ultimately had to revert it because certain aspects were broken (login
>> with Basic Auth - discussion at - "[Dev] UserRegistry sends null to
>> JDBCAuthorizationManager"). Bottom line is the CC API is not as robust as
>> we would like it to be, we should put some thought into getting the API
>> cleaned up. One major issue when it comes tinkering with CC API is that its
>> crosscutting nature and some issue showing up only for very specific cases.
>> Anyway we need to give it some thought, in C5 at the very least.
>>
>>
> What I'd like to see is all APIs which create the CC using MessageContext,
> AxisConfig etc. being removed, and the only way to get the CC should be
> through the Thread context. Any running thread should have a valid CC
> associated with it at all times.
>

Since the CarbonContextCreatorValve does the initializing we should be able
to go ahead with this approach, at the moment
CarbonContext.getCurrentContext() first try to create the CC using
MessageContext, then ConfigurationContext and finally ThreadLocal
(CarbonContextDataHolder#getCurrentCarbonContextHolder()), changing this
order to give priority TL did work for most cases, so we can try to fix the
edge cases.

Also getUsername() simply returns username value, it doesn't try to fetch
the username if its null, guess we should fix those too. What I usually
hear is that upstream code should set those values, however I am yet to
find that upstream code .. :) .. Can't we do it within the CC API it self
?!




-- 
Thanks,
Shariq.
Phone: +94 777 202 225
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to