click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malcolm Edgar (JIRA)" <>
Subject [jira] Commented: (CLK-642) Fix the logic to manage Context with ThreadLocal
Date Fri, 12 Mar 2010 22:49:27 GMT


Malcolm Edgar commented on CLK-642:

The context stack is used to deal with the issue of pages being able to forward to another
page.  In this scenario, the request is still being handled by the same thread in the ServletContainer.

> Fix the logic to manage Context with ThreadLocal
> ------------------------------------------------
>                 Key: CLK-642
>                 URL:
>             Project: Click
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.2.0
>            Reporter: Henry Saputra
>            Priority: Minor
>         Attachments: context_change.patch
> Currently, the Context class maintains a ThreadLocal<ContextStack> instance to
store all contexts created for each Click request. However since Clck is using  servlet mechanism,
each request will be processed in a separate thread so there should be just a single Context
in a thread execution lifetime.
> Within a thread scope, we could just use ThreadLocal<Context> to manage a single
context  since ThreadLocal guarantee a unique instance per thread.
> I dont think we need to manage the Context instances in ContextStack because there should
be only one Context instance per request, which supported by execution in a separate thread
for each request and ThreadLocal.
> I created repository for Click in to help with code review and
created an entry for this JIRA:

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message