Author: julien(a)jboss.com
Date: 2007-03-19 21:37:29 -0400 (Mon, 19 Mar 2007)
New Revision: 6762
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
Log:
fixing bad timing for setting the portlet container info on portlet invocation
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-03-20
00:31:30 UTC (rev 6761)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2007-03-20
01:37:29 UTC (rev 6762)
@@ -59,7 +59,7 @@
// Add declaratively injected header content here (get it via the component)
String headerChars = fragment.getHeader(); // Chris' modif: note that the
header might to be re-written...
- PortletContainer container =
((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container =
((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
JBossPortletMetaData portletMD =
(JBossPortletMetaData)container.getJBossMetaData();
if (portletMD != null)
{
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-03-20
00:31:30 UTC (rev 6761)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2007-03-20
01:37:29 UTC (rev 6762)
@@ -49,7 +49,7 @@
{
protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
{
- PortletContainer container =
((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container =
((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
Valve valve = container.getValve();
// Try to aquire the valve
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-20
00:31:30 UTC (rev 6761)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-20
01:37:29 UTC (rev 6762)
@@ -75,24 +75,20 @@
public Object invoke(Invocation invocation) throws Exception,
org.jboss.portal.common.invocation.InvocationException
{
PortletInvocation portletInvocation = (PortletInvocation)invocation;
- PortletContext ctx = portletInvocation.getTarget();
- Portlet portlet = getPortlet(ctx);
- ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
//
try
{
portletInvocation.setHandler(null);
- invocation.setAttribute(PortletInvocation.REQUEST_SCOPE,
PORTLET_CONTAINER_INFO, info);
//
+ ContainerPortletInfo info =
(ContainerPortletInfo)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE,
PortletContainerInvoker.PORTLET_CONTAINER_INFO);
PortletContainer container = info.getContainer();
return container.dispatch(portletInvocation);
}
finally
{
portletInvocation.setHandler(this);
- invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE,
PORTLET_CONTAINER_INFO);
}
}
};
@@ -188,10 +184,17 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws
PortletInvokerException, InvocationException
{
+ PortletContext ctx = invocation.getTarget();
+ Portlet portlet = getPortlet(ctx);
+ ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
+
+ //
InvocationHandler prevHandler = invocation.getHandler();
try
{
+
invocation.setHandler(handler);
+ invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PORTLET_CONTAINER_INFO,
info);
return
(PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
}
catch (Exception e)
@@ -212,6 +215,7 @@
finally
{
invocation.setHandler(prevHandler);
+ invocation.removeAttribute(PortletInvocation.REQUEST_SCOPE,
PORTLET_CONTAINER_INFO);
}
}
Show replies by date