Author: chris.laprun(a)jboss.com
Date: 2007-05-18 00:04:41 -0400 (Fri, 18 May 2007)
New Revision: 7271
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
Log:
- Use local variable for CapabilitiesInfo to avoid having to retrieve the portlet several
times as it could be costly with WSRP.
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-05-17
21:40:09 UTC (rev 7270)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-05-18
04:04:41 UTC (rev 7271)
@@ -22,56 +22,57 @@
******************************************************************************/
package org.jboss.portal.core.impl.model.content;
+import org.jboss.logging.Logger;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.Exceptions;
+import org.jboss.portal.core.aspects.portlet.AjaxInterceptor;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ControllerResponse;
+import org.jboss.portal.core.controller.ResourceAccessDeniedException;
+import org.jboss.portal.core.controller.ResourceNotFoundException;
+import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
+import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.Window;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
-import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.content.ContentRenderer;
import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
-import org.jboss.portal.core.model.portal.content.ContentRenderer;
-import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.controller.ResourceNotFoundException;
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.controller.ResourceAccessDeniedException;
-import org.jboss.portal.core.controller.ControllerResponse;
-import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
import org.jboss.portal.core.navstate.NavigationalStateKey;
import org.jboss.portal.core.theme.WindowRendition;
-import org.jboss.portal.core.aspects.portlet.AjaxInterceptor;
-import org.jboss.portal.server.config.ServerConfig;
-import org.jboss.portal.server.ServerInvocationContext;
-import org.jboss.portal.server.request.URLContext;
-import org.jboss.portal.server.request.URLFormat;
+import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
-import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
-import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portal.server.config.ServerConfig;
+import org.jboss.portal.server.request.URLContext;
+import org.jboss.portal.server.request.URLFormat;
+import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.portal.theme.render.renderer.ActionRendererContext;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.Exceptions;
-import org.jboss.logging.Logger;
-import java.util.Map;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Collections;
+import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -239,7 +240,8 @@
//
List supportedWindowStates = new ArrayList();
- for (Iterator i =
instance.getPortlet().getInfo().getCapabilities().getAllWindowStates().iterator();
i.hasNext();)
+ CapabilitiesInfo capabilitiesInfo =
instance.getPortlet().getInfo().getCapabilities();
+ for (Iterator i = capabilitiesInfo.getAllWindowStates().iterator();
i.hasNext();)
{
WindowStateInfo windowStateInfo = (WindowStateInfo)i.next();
WindowState tmp = windowStateInfo.getWindowState();
@@ -251,7 +253,7 @@
//
List supportedModes = new ArrayList();
- for (Iterator i =
instance.getPortlet().getInfo().getCapabilities().getAllModes().iterator(); i.hasNext();)
+ for (Iterator i = capabilitiesInfo.getAllModes().iterator(); i.hasNext();)
{
ModeInfo modeInfo = (ModeInfo)i.next();
Mode tmp = modeInfo.getMode();
Show replies by date