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/08 13:28:38 UTC

PortletDriver & PortletDriverRegistry doubt

 From Javadoc of org.apache.wsrp4j.consumer.PortletDriver:

/**
  * The portlet driver is a wrapper for all action which can be performed on an
  * portlet. There is one portlet driver for all instances of an portlet.
  */
joer
This isn't clear for me, there is one PortletDriver for EVERY Portlet created? 
(I mean every portletHandle). I think this description should be rewritten.

On the other hand, PortletDriverRegistry is supposed to be a registry of 
PortletDriver instances. In 
org.apache.wsrp4j.consumer.driver.PortletDriverRegistryImpl the instances are 
supposed to be stored in a hashtable:

...
public class PortletDriverRegistryImpl implements PortletDriverRegistry
{

     private static PortletDriverRegistry instance = null;
     private Hashtable portletDrivers = null;
     private ConsumerEnvironment consumerEnv = null;
...

However, it seems there is no way to cache the PortletDriver instances in the 
hashtable, because it doesn't exist any method like 
"addPortletDriverToHashTable", and the method getPortletDriver doesn't cache at 
all:

     /**
      * Get an portlet driver for the given portlet. If there is no portlet driver
      * object cached a new portlet driver will be created and returned.
      *
      * @param portlet The portlet the returned portlet driver is bind to
      *
      * @return The portlet driver for this portlet
      **/
     public PortletDriver getPortletDriver(WSRPPortlet portlet) throws 
WSRPException
     {

         PortletDriver driver = null;

         if ((driver = 
(PortletDriver)portletDrivers.get(portlet.getPortletKey().toString())) == null)
         {
             driver = new PortletDriverImpl(portlet, consumerEnv);
         }

         return driver;
     }

Am I wrong with this?

Regards.
Diego.

Re: PortletDriver & PortletDriverRegistry doubt

Posted by Diego Louzán <di...@metalicana.org>.
I've patched this issue locally and everything works fine. I believe it's a bug 
not caching the ProxyDriver instances. If no committer disagrees, I'll add a 
JIRA issue and a patch for it.

Regards.
Diego.

Diego Louzán wrote:
>  From Javadoc of org.apache.wsrp4j.consumer.PortletDriver:
> 
> /**
>  * The portlet driver is a wrapper for all action which can be performed 
> on an
>  * portlet. There is one portlet driver for all instances of an portlet.
>  */
> joer
> This isn't clear for me, there is one PortletDriver for EVERY Portlet 
> created? (I mean every portletHandle). I think this description should 
> be rewritten.
> 
> On the other hand, PortletDriverRegistry is supposed to be a registry of 
> PortletDriver instances. In 
> org.apache.wsrp4j.consumer.driver.PortletDriverRegistryImpl the 
> instances are supposed to be stored in a hashtable:
> 
> ...
> public class PortletDriverRegistryImpl implements PortletDriverRegistry
> {
> 
>     private static PortletDriverRegistry instance = null;
>     private Hashtable portletDrivers = null;
>     private ConsumerEnvironment consumerEnv = null;
> ...
> 
> However, it seems there is no way to cache the PortletDriver instances 
> in the hashtable, because it doesn't exist any method like 
> "addPortletDriverToHashTable", and the method getPortletDriver doesn't 
> cache at all:
> 
>     /**
>      * Get an portlet driver for the given portlet. If there is no 
> portlet driver
>      * object cached a new portlet driver will be created and returned.
>      *
>      * @param portlet The portlet the returned portlet driver is bind to
>      *
>      * @return The portlet driver for this portlet
>      **/
>     public PortletDriver getPortletDriver(WSRPPortlet portlet) throws 
> WSRPException
>     {
> 
>         PortletDriver driver = null;
> 
>         if ((driver = 
> (PortletDriver)portletDrivers.get(portlet.getPortletKey().toString())) 
> == null)
>         {
>             driver = new PortletDriverImpl(portlet, consumerEnv);
>         }
> 
>         return driver;
>     }
> 
> Am I wrong with this?
> 
> Regards.
> Diego.
>