Author: chris.laprun(a)jboss.com
Date: 2011-09-14 15:20:11 -0400 (Wed, 14 Sep 2011)
New Revision: 7426
Modified:
components/pc/trunk/federation/src/main/java/org/gatein/pc/federation/impl/FederatingPortletInvokerService.java
Log:
- Do not attempt to resolve invoker until we know it's needed in getPortlets.
- Improved getResolvedInvokerIds and getFederatedInvokerIds.
Modified:
components/pc/trunk/federation/src/main/java/org/gatein/pc/federation/impl/FederatingPortletInvokerService.java
===================================================================
---
components/pc/trunk/federation/src/main/java/org/gatein/pc/federation/impl/FederatingPortletInvokerService.java 2011-09-14
17:35:05 UTC (rev 7425)
+++
components/pc/trunk/federation/src/main/java/org/gatein/pc/federation/impl/FederatingPortletInvokerService.java 2011-09-14
19:20:11 UTC (rev 7426)
@@ -141,18 +141,18 @@
public Collection<String> getFederatedInvokerIds()
{
- final Collection<String> ids = getResolvedInvokerIds();
- ids.addAll(nullHandler.getKnownInvokerIds());
+ final Collection<String> resolvedIds = getResolvedInvokerIds();
+ final Collection<String> resolvableIds = nullHandler.getKnownInvokerIds();
+ final HashSet<String> ids = new HashSet<String>(resolvedIds.size() +
resolvableIds.size());
+ ids.addAll(resolvedIds);
+ ids.addAll(resolvableIds);
return ids;
}
public Collection<String> getResolvedInvokerIds()
{
- Set<String> ids = new HashSet<String>(invokerCache.size() * 2);
- ids.addAll(invokerCache.keySet());
-
- return ids;
+ return invokerCache.keySet();
}
public boolean isResolved(String federatedId) throws IllegalArgumentException
@@ -172,9 +172,7 @@
LinkedHashSet<Portlet> portlets = new LinkedHashSet<Portlet>();
for (String invokerId : getFederatedInvokerIds())
{
- final FederatedPortletInvoker federated = getFederatedInvoker(invokerId);
-
- if (LOCAL_PORTLET_INVOKER_ID.equals(federated.getId()))
+ if (LOCAL_PORTLET_INVOKER_ID.equals(invokerId))
{
// skip invoker if it's local and we don't want local portlets
if (!includeLocalPortlets)
@@ -191,6 +189,8 @@
}
}
+ final FederatedPortletInvoker federated = getFederatedInvoker(invokerId);
+
try
{
Set<Portlet> offeredPortlets = federated.getPortlets();