cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: [2.1] AbstractCachingProcessingPipeline and cocoon CLI
Date Fri, 22 Aug 2008 12:18:58 GMT
On Aug 22, 2008, at 3:35 AM, Thorsten Scherler wrote:

> How about:
>                 } else {
> -                    Object lock =
> env.getObjectModel().get(HttpEnvironment.HTTP_REQUEST_OBJECT);
> +                    Object lock =
> env.getObjectModel().get(ObjectModelHelper.REQUEST_OBJECT);
>                     try {
>                         transientStore.store(lockKey, lock);
>                     } catch (IOException e) {
>
> This way we always lock the same object.

Exactly this thing I was trying to explain - it will not work because  
instead of using top level request you are suggesting to use current  
sub-request.

Take a look at EnvironmentWrapper (which is used e.g. in SitemapSource):

         // create new object model and replace the request object
         Map oldObjectModel = env.getObjectModel();
         if (oldObjectModel instanceof HashMap) {
             this.objectModel = (Map)((HashMap)oldObjectModel).clone();
         } else {
             this.objectModel = new HashMap(oldObjectModel.size()*2);
             Iterator entries = oldObjectModel.entrySet().iterator();
             Map.Entry entry;
             while (entries.hasNext()) {
                 entry = (Map.Entry)entries.next();
                 this.objectModel.put(entry.getKey(), entry.getValue());
             }
         }
         this.request = new  
RequestWrapper(ObjectModelHelper.getRequest(oldObjectModel),
                                           requestURI,
                                           queryString,
                                           this,
                                           rawMode);
         this.objectModel.put(ObjectModelHelper.REQUEST_OBJECT,  
this.request);


Vadim

Mime
View raw message