[ 
http://www.stripesframework.org/jira/browse/STS-891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876#comment-12876
 ] 

Frederic Daoud commented on STS-891:
------------------------------------

@Remi, you are correct. Can't put null in ConcurrentHashMap. Our workaround was 
to define an object to represent a null:

    private static HttpCache nullCache = new HttpCache() {
                public Class<? extends Annotation> annotationType() {return 
null;}
                public int expires() {
                                return 0;
                }
                public boolean allow() {
                        return false;
                }
    };

So if the value wanting to be put in the map is null, we put nullCache instead. 
Conversely, if we get nullCache back from the map, we return null.


> Cache in HttpCacheInterceptor needs to be concurrent
> ----------------------------------------------------
>
>                 Key: STS-891
>                 URL: http://www.stripesframework.org/jira/browse/STS-891
>             Project: Stripes
>          Issue Type: Bug
>    Affects Versions: Release 1.5.3
>            Reporter: Frederic Daoud
>            Assignee: Frederic Daoud
>             Fix For: Release 1.5.8, Release 1.6
>
>
> In HttpCacheInterceptor, the cache needs to be a concurrent hash map. In a 
> high-volume environment, accessing the cache can lead to race conditions and 
> excessively high load.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to