You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by Diego Louzán <di...@metalicana.org> on 2004/11/16 13:15:18 UTC

Synchronizing in org.apache.wsrp4j.consumer.portlet.impl.ProxyPortlet

     In method render of class 
org.apache.wsrp4j.consumer.portlet.impl.ProxyPortlet (line 413):

synchronized (urlGenLock)
{
     // update url generator
     URLGenerator urlGenerator = URLGeneratorImpl.getInstance(renderResponse,
           getPortletConfig());
     URLTemplateComposer templateComposer = consumerEnv.getTemplateComposer();
     if(templateComposer != null)
     {
         templateComposer.setURLGenerator(urlGenerator);
     }
     consumerEnv.getURLRewriter().setURLGenerator(urlGenerator);
}

     From the beginning I supposed that this lock was to prevent another thread 
changing the renderResponse object associated to the URLGeneratorImpl for 
url-rewriting. However, the call to get markup (and hence url-rewriting) is 
made outside of the synchronized block in line 429:

response = portletDriver.getMarkup(markupRequest, userID);

     So, this way, another thread running concurrently could change the 
renderResponse object of URLGenerator BEFORE making the getMarkup call. I think 
this is a bug. Am I missing something?