I saw that the Pluto's libraries are used in org.apache.wsrp4j.consumer.proxyportlet.impl.ProxyPortlet and org.apache.wsrp4j.consumer.proxyportlet.impl.WSRPRequestImpl classes.
In ProxyPortlet class the Pluto's libraries are used in the processAction, render and getWindowSession methods. In this cases Pluto's libraries are always used to obtain the portlet window object and this is used to obtain the portlet window ID or the portlet entity ID.
What is a portlet window in Pluto? Portlet Window is part of an aggregation tree that contains the portlet markup. Reading the JSR-168 Specification we can read the phrase "The occurrence of a portlet and preferences-object in a portal page is called a portlet window." Are both the same thing? I think that both are the same thing. Does some mechanism exist to identify unambiguously the portlet window in the JSR-168 Specification? Yes it does, the used mechanism is the portlet namespace. Therefore, in my code I use the namespace instead of the portlet window ID, because the namespace is standard and portlet window ID is Pluto dependent.
What we can do with portlet entity ID? The portlet entity in Pluto is a parameterized portlet definition, belonging to a user. I understand that an entity is a portlet + preferences-object, belonging to a user. Can the portlet entity ID be changed by standard something? I searched it in the JSR-168 Specification but I didn't find it. Then I asked myself, which is the use of portlet entity ID? The portlet entity ID is used in GroupSessionImpl class as key to store a portlet session object in a hashtable, and this portlet session object contains a session context and a Map where are stored window session objects, in this Map the used key is the portlet window ID, that is, the namespace. Firstly I thought change this structure, in my mind I thought in a unique structure where the key was the namespace, but I don't have enough time to try it and I don't have enough knowledge about WSRP4J proxy portlet code. Then I found a more simple solution, I realised that if I used the portlet name instead of portlet entity ID, my solution was correct in all those cases where the portlet entity was the same for all portlet windows, that is, if I had a unique portlet entity declaration in the portletentityregistry.xml file and I used this entity several times in the pageregistry.xml file, the portlet name worked correctly as key. But if other portlet entity declaration existed then the portlet name wasn't useful as key.
Thinking in this situation I realised that this is a good solution, what? let me explain. The mistake of this solution is that only a unique entity declaration can exist per portlet declaration in the portlet deployment descriptor file. Why not have one portlet declaration in the portlet deployment descriptor file (portlet.xml) per entity? If we have different entity declarations it's because we have different preferences for same portlet. In the case of proxy portlet it involves to load a different portlet from provider or change the provider, bear it in mind. If all these remote portlets were local portlets then a portlet declaration per each one would exist. Moreover, this solution doesn't require big changes in source code. This is my solution to achieve independence of WSRP4J Proxy Portlet from Pluto.
Finally, in WSRPRequestImpl class I use the same idea, except in the case where Pluto's libraries are used to read the MIME types set. Read the code, this is commented.
Excuse me for my bad English. Any opinion about it will be welcome, thanks in advance.
PD: This solution includes the code that solves a bug registered in Jira with code