[jboss-svn-commits] JBoss Portal SVN: r5426 - in trunk: bridge/src/main/org/jboss/portal/bridge cms/src/main/org/jboss/portal/cms cms/src/main/org/jboss/portal/cms/impl/interceptors cms/src/main/org/jboss/portal/cms/impl/jcr common/src/main/org/jboss/portal/common/invocation core/src/main/org/jboss/portal/core/aspects/controller core/src/main/org/jboss/portal/core/aspects/controller/node core/src/main/org/jboss/portal/core/aspects/portlet core/src/main/org/jboss/portal/core/controller core/src/main/org/jboss/portal/core/controller/ajax core/src/main/org/jboss/portal/core/controller/command core/src/main/org/jboss/portal/core/impl/model/instance core/src/main/org/jboss/portal/core/impl/portlet/state core/src/main/org/jboss/portal/core/model/instance core/src/main/org/jboss/portal/test/core/model/instance core/src/main/org/jboss/portal/test/core/state federation/src/main/org/jboss/portal/federation/impl portlet/src/main/org/jboss/portal/portlet portlet/src/main/org/jboss/portal/portlet/! aspects/portlet portlet/src/main/org/jboss/portal/portlet/container portlet/src/main/org/jboss/portal/portlet/invocation portlet/src/main/org/jboss/portal/portlet/state/consumer portlet/src/main/org/jboss/portal/portlet/state/producer portlet/src/main/org/jboss/portal/portlet/test portlet/src/main/org/jboss/portal/portlet/test/support portlet/src/main/org/jboss/portal/test/portlet/state server/src/main/org/jboss/portal/server server/src/main/org/jboss/portal/server/impl/invocation wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer wsrp/src/main/org/jboss/portal/wsrp/aspects/portlet wsrp/src/main/org/jboss/portal/wsrp/consumer wsrp/src/main/org/jboss/portal/wsrp/producer
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Oct 11 18:18:52 EDT 2006
Author: julien at jboss.com
Date: 2006-10-11 18:17:42 -0400 (Wed, 11 Oct 2006)
New Revision: 5426
Modified:
trunk/bridge/src/main/org/jboss/portal/bridge/BridgeInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/CMSInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/CacheInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/LogInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommand.java
trunk/common/src/main/org/jboss/portal/common/invocation/Interceptor.java
trunk/common/src/main/org/jboss/portal/common/invocation/Invocation.java
trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageNavigationInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PolicyEnforcementInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/WindowCacheInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/ControllerCommand.java
trunk/core/src/main/org/jboss/portal/core/controller/ControllerContext.java
trunk/core/src/main/org/jboss/portal/core/controller/ControllerInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/CoreController.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/command/InvokeWindowActionCommand.java
trunk/core/src/main/org/jboss/portal/core/controller/command/RenderPageCommand.java
trunk/core/src/main/org/jboss/portal/core/controller/command/RenderWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java
trunk/core/src/main/org/jboss/portal/core/impl/model/instance/PersistentInstanceContainer.java
trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/ProducerPortletInvoker.java
trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
trunk/federation/src/main/org/jboss/portal/federation/impl/FederatedPortletInvokerService.java
trunk/federation/src/main/org/jboss/portal/federation/impl/FederatingPortletInvokerService.java
trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
trunk/server/src/main/org/jboss/portal/server/RequestControllerDispatcher.java
trunk/server/src/main/org/jboss/portal/server/ServerInterceptor.java
trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInterceptor.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/aspects/portlet/DumpInterceptor.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
Log:
make portlet invocation return a PortletInvocationResponse object
Modified: trunk/bridge/src/main/org/jboss/portal/bridge/BridgeInterceptor.java
===================================================================
--- trunk/bridge/src/main/org/jboss/portal/bridge/BridgeInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/bridge/src/main/org/jboss/portal/bridge/BridgeInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -33,7 +33,7 @@
public class BridgeInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception
+ protected Object invoke(PortletInvocation invocation) throws Exception
{
try
{
@@ -42,7 +42,7 @@
JBossServletContextProvider.set(bridgeInfo);
// Proceed to invocation
- invocation.invokeNext();
+ return invocation.invokeNext();
}
finally
{
Modified: trunk/cms/src/main/org/jboss/portal/cms/CMSInterceptor.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/CMSInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/cms/src/main/org/jboss/portal/cms/CMSInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -32,11 +32,11 @@
public abstract class CMSInterceptor extends JBossInterceptor
{
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
- invoke((JCRCommand)invocation);
+ return invoke((JCRCommand)invocation);
}
- protected abstract void invoke(JCRCommand invocation) throws Exception, InvocationException;
+ protected abstract Object invoke(JCRCommand invocation) throws Exception, InvocationException;
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/CacheInterceptor.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/CacheInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/CacheInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -61,7 +61,7 @@
}
}
- protected void invoke(JCRCommand invocation) throws Exception, InvocationException
+ protected Object invoke(JCRCommand invocation) throws Exception, InvocationException
{
// lazy loading of cache
if (cache == null)
@@ -83,7 +83,7 @@
{
e.printStackTrace();
}
- invocation.invokeNext();
+ return invocation.invokeNext();
}
else if (invocation instanceof UpdateFileCommand)
{
@@ -100,7 +100,7 @@
{
e.printStackTrace();
}
- invocation.invokeNext();
+ return invocation.invokeNext();
}
else if ((invocation instanceof FileGetCommand))
{
@@ -112,23 +112,23 @@
if (file != null)
{
log.trace(file.getBasePath() + "/" + locale + " obtained from cache");
- invocation.setResult(file);
+ return file;
}
else
{
- invocation.invokeNext();
- File result = (File) invocation.getResult();
+ File result = (File)invocation.invokeNext();
if (result != null)
{
log.trace(path + "/" + locale + " written to cache");
cache.put(path, locale, result);
}
+ return result;
}
}
else
{
log.trace("Command not trapped by the cache interceptor: " + invocation);
- invocation.invokeNext();
+ return invocation.invokeNext();
}
}
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/LogInterceptor.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/LogInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/LogInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -33,12 +33,13 @@
public class LogInterceptor extends CMSInterceptor
{
- protected void invoke(JCRCommand invocation) throws Exception, InvocationException
+ protected Object invoke(JCRCommand invocation) throws Exception, InvocationException
{
Date startDate = new Date();
- invocation.invokeNext();
+ Object resp = invocation.invokeNext();
Date endDate = new Date();
System.out.println(invocation + " executed in " + (endDate.getTime() - startDate.getTime()) + "ms");
+ return resp;
}
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -94,10 +94,10 @@
private InvocationHandler handler = new InvocationHandler()
{
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
JCRCommand cmd = (JCRCommand)invocation;
- cmd.dispatch();
+ return cmd.execute();
}
};
@@ -442,7 +442,7 @@
}
};
- Object obj = new Object();
+ Object obj = null;
try
{
xares.start(xid,XAResource.TMNOFLAGS);
@@ -456,15 +456,14 @@
if ((stackFactory != null) && (stackFactory.getInterceptorStack().getLength() != 0))
{
jcrCmd.setHandler(handler);
- jcrCmd.invoke(stackFactory.getInterceptorStack());
+ obj = jcrCmd.invoke(stackFactory.getInterceptorStack());
jcrCmd.setHandler(null);
}
else
{
- jcrCmd.dispatch();
+ obj = jcrCmd.execute();
}
- obj = jcrCmd.getResult();
-
+
//committ the transaction
xares.end(xid, XAResource.TMSUCCESS);
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommand.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommand.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommand.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -43,8 +43,6 @@
protected JCRCommandContext context;
- private Object result;
-
public InvocationContext getContext()
{
return context;
@@ -56,20 +54,4 @@
}
public abstract Object execute() throws CMSException;
-
- protected void dispatch() throws Exception, InvocationException
- {
- Object object = execute();
- setResult(object);
- }
-
- public Object getResult()
- {
- return result;
- }
-
- public void setResult(Object result)
- {
- this.result = result;
- }
}
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/Interceptor.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/Interceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/Interceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -30,5 +30,5 @@
/**
* todo
*/
- void invoke(Invocation invocation) throws Exception, InvocationException;
+ Object invoke(Invocation invocation) throws Exception, InvocationException;
}
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/Invocation.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/Invocation.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/Invocation.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -101,7 +101,7 @@
* Invoke the next interceptor in the chain. If the end of the chain is reached then the <code>dispatch()</code>
* is invoked.
*/
- public void invokeNext() throws Exception, InvocationException
+ public Object invokeNext() throws Exception, InvocationException
{
if (currentIndex < currentStack.getLength())
{
@@ -114,7 +114,7 @@
}
else
{
- interceptor.invoke(this);
+ return interceptor.invoke(this);
}
}
finally
@@ -130,7 +130,7 @@
}
else
{
- handler.invoke(this);
+ return handler.invoke(this);
}
}
}
@@ -138,7 +138,7 @@
/**
* Execute the invocation through the chain of interceptors.
*/
- public void invoke(InterceptorStack newStack) throws Exception, InvocationException
+ public Object invoke(InterceptorStack newStack) throws Exception, InvocationException
{
if (newStack == null)
{
@@ -156,7 +156,7 @@
currentIndex = 0;
// Perform invoke
- invokeNext();
+ return invokeNext();
}
finally
{
Modified: trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/common/src/main/org/jboss/portal/common/invocation/InvocationHandler.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -33,5 +33,5 @@
/**
*
*/
- void invoke(Invocation invocation) throws Exception, InvocationException;
+ Object invoke(Invocation invocation) throws Exception, InvocationException;
}
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -77,15 +77,15 @@
this.portalAuthorizationManagerFactory = portalAuthorizationManagerFactory;
}
- public void invoke(ControllerCommand cmd) throws Exception
+ public Object invoke(ControllerCommand cmd) throws Exception
{
- cmd.invokeNext();
+ Object resp = cmd.invokeNext();
// Insert navigation portlet in the page
if (cmd instanceof RenderPageCommand)
{
RenderPageCommand rpc = (RenderPageCommand)cmd;
- PageRendition rendition = (PageRendition)rpc.getResponse();
+ PageRendition rendition = (PageRendition)resp;
if (rendition != null)
{
// No tab in dashboard mode TODO: why not?
@@ -128,6 +128,9 @@
}
}
}
+
+ //
+ return resp;
}
public StringBuffer injectDashboardNav(RenderPageCommand rpc)
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageNavigationInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageNavigationInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageNavigationInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -50,7 +50,7 @@
private static final Logger log = Logger.getLogger(PageNavigationInterceptor.class);
- public void invoke(ControllerCommand cmd) throws Exception, InvocationException
+ public Object invoke(ControllerCommand cmd) throws Exception, InvocationException
{
if (cmd instanceof WindowCommand || cmd instanceof PageCommand)
{
@@ -81,7 +81,7 @@
}
}
- cmd.invokeNext();
+ return cmd.invokeNext();
}
public static void updatePageNavigationalState(LayoutService layoutService, ControllerContext cmdContext,
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PolicyEnforcementInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PolicyEnforcementInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PolicyEnforcementInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -58,14 +58,14 @@
* @param cmd
* @throws org.jboss.portal.common.invocation.InvocationException
*/
- public void invoke(ControllerCommand cmd) throws Exception, InvocationException
+ public Object invoke(ControllerCommand cmd) throws Exception, InvocationException
{
try
{
PortalAuthorizationManagerFactory pamf = cmd.getControllerContext().getController().getPortalAuthorizationManagerFactory();
PortalAuthorizationManager pam = pamf.getManager();
cmd.enforceSecurity(pam);
- cmd.invokeNext();
+ return cmd.invokeNext();
}
catch (PortalSecurityException e)
{
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/WindowCacheInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/WindowCacheInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/WindowCacheInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -26,6 +26,7 @@
import org.jboss.portal.core.controller.command.RenderWindowCommand;
import org.jboss.portal.core.controller.command.InvokeWindowCommand;
import org.jboss.portal.core.controller.command.WindowCommand;
+import org.jboss.portal.core.controller.command.response.PortletResponse;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.invocation.InvocationContext;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
@@ -42,7 +43,7 @@
*/
public class WindowCacheInterceptor extends ControllerInterceptor
{
- public void invoke(ControllerCommand cmd) throws Exception, InvocationException
+ public Object invoke(ControllerCommand cmd) throws Exception, InvocationException
{
if (cmd instanceof WindowCommand)
{
@@ -81,10 +82,10 @@
if (fragment == null)
{
// Invoke
- cmd.invokeNext();
+ PortletResponse pr = (PortletResponse)cmd.invokeNext();
// Get result
- PortletInvocationResponse response = ((org.jboss.portal.core.controller.command.response.PortletResponse)rwc.getResponse()).getResult();
+ PortletInvocationResponse response = pr.getResult();
// Try to cache any fragment result
if (response instanceof FragmentResponse)
@@ -109,11 +110,14 @@
invocationCtx.setAttribute(ServerInvocation.PRINCIPAL_SCOPE, scopeKey, cacheEntry);
}
}
+
+ //
+ return pr;
}
else
{
// Use the cached fragment
- rwc.setResponse(new org.jboss.portal.core.controller.command.response.PortletResponse(rwc.getTargetId(), fragment));
+ return new PortletResponse(rwc.getTargetId(), fragment);
}
}
else if (cmd instanceof InvokeWindowCommand)
@@ -121,16 +125,16 @@
invocationCtx.removeAttribute(ServerInvocation.PRINCIPAL_SCOPE, scopeKey);
//
- cmd.invokeNext();
+ return cmd.invokeNext();
}
else
{
- cmd.invokeNext();
+ return cmd.invokeNext();
}
}
else
{
- cmd.invokeNext();
+ return cmd.invokeNext();
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -25,7 +25,6 @@
import org.jboss.portal.core.controller.ControllerInterceptor;
import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.CommandRedirectionException;
import org.jboss.portal.core.controller.command.InvokeWindowRenderCommand;
import org.jboss.portal.core.controller.command.InvokeWindowActionCommand;
@@ -73,7 +72,7 @@
this.listenerRegistry = listenerRegistry;
}
- public void invoke(ControllerCommand cmd) throws Exception, InvocationException
+ public Object invoke(ControllerCommand cmd) throws Exception, InvocationException
{
PortalObjectNode node = Navigation.getCurrentNode();
@@ -183,7 +182,7 @@
}
else
{
- cmd.invokeNext();
+ return cmd.invokeNext();
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -39,7 +39,7 @@
// private static Logger log = Logger.getLogger(PortalNodeInterceptor.class);
- public void invoke(ControllerCommand cmd) throws Exception, InvocationException
+ public Object invoke(ControllerCommand cmd) throws Exception, InvocationException
{
// Get the next node
PortalObjectNode next = getNode(cmd);
@@ -53,7 +53,7 @@
Navigation.setCurrentNode(next);
// Invoke
- cmd.invokeNext();
+ return cmd.invokeNext();
}
finally
{
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 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -44,14 +44,11 @@
public class HeaderInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- invocation.invokeNext();
+ PortletInvocationResponse response = (PortletInvocationResponse)invocation.invokeNext();
//
- PortletInvocationResponse response = invocation.getResponse();
-
- //
if (response instanceof FragmentResponse)
{
RenderInvocation render = (RenderInvocation)invocation;
@@ -80,6 +77,9 @@
//
fragment.setHeader(headerChars);
}
+
+ //
+ return response;
}
protected void write(HeaderContentMetaData headerContent, StringWriter writer, String contextPath)
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/TransactionInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -36,7 +36,7 @@
public class TransactionInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
// The default type is that it does not propagate
Transactions.Type txType = Transactions.TYPE_NOT_SUPPORTED;
@@ -52,27 +52,27 @@
//
if (txType == Transactions.TYPE_NOT_SUPPORTED)
{
- invokeNotSupported(invocation);
+ return invokeNotSupported(invocation);
}
else if (txType == Transactions.TYPE_NEVER)
{
- invokeNever(invocation);
+ return invokeNever(invocation);
}
else if (txType == Transactions.TYPE_MANDATORY)
{
- invokeMandatory(invocation);
+ return invokeMandatory(invocation);
}
else if (txType == Transactions.TYPE_SUPPORTS)
{
- invokeSupports(invocation);
+ return invokeSupports(invocation);
}
else if (txType == Transactions.TYPE_REQUIRED)
{
- invokeRequired(invocation);
+ return invokeRequired(invocation);
}
else if (txType == Transactions.TYPE_REQUIRES_NEW)
{
- invokeRequiresNew(invocation);
+ return invokeRequiresNew(invocation);
}
else
{
@@ -80,33 +80,33 @@
}
}
- protected void invokeNotSupported(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invokeNotSupported(PortletInvocation invocation) throws Exception, InvocationException
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
- protected void invokeNever(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invokeNever(PortletInvocation invocation) throws Exception, InvocationException
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
- protected void invokeMandatory(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invokeMandatory(PortletInvocation invocation) throws Exception, InvocationException
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
- protected void invokeSupports(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invokeSupports(PortletInvocation invocation) throws Exception, InvocationException
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
- protected void invokeRequired(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invokeRequired(PortletInvocation invocation) throws Exception, InvocationException
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
- protected void invokeRequiresNew(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invokeRequiresNew(PortletInvocation invocation) throws Exception, InvocationException
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ControllerCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ControllerCommand.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ControllerCommand.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -58,16 +58,13 @@
/** The context of the command. */
protected ControllerContext context;
- /** The response. */
- private Object response;
-
/** Execute command when the end of the stack is reached. */
private static final InvocationHandler handler = new InvocationHandler()
{
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
ControllerCommand cmd = (ControllerCommand)invocation;
- cmd.response = cmd.execute();
+ return cmd.execute();
}
};
@@ -76,16 +73,6 @@
setHandler(handler);
}
- public Object getResponse()
- {
- return response;
- }
-
- public void setResponse(Object response)
- {
- this.response = response;
- }
-
/**
* Return the meta data of this command.
*/
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ControllerContext.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ControllerContext.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ControllerContext.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -64,7 +64,7 @@
addResolver(ControllerCommand.PRINCIPAL_SCOPE, serverInvocation.getContext());
}
- public void execute(ControllerCommand command) throws ControllerException, InvocationException
+ public Object execute(ControllerCommand command) throws ControllerException, InvocationException
{
if (command == null)
{
@@ -81,11 +81,12 @@
InterceptorStack commandStack = controller.getStackFactory().getInterceptorStack();
//
- command.invoke(commandStack);
+ return command.invoke(commandStack);
}
catch (Exception e)
{
ControllerCommand.rethrow(e);
+ throw new Error("Should not happen");
}
finally
{
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ControllerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ControllerInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ControllerInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -33,10 +33,10 @@
public abstract class ControllerInterceptor extends JBossInterceptor
{
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
- invoke((ControllerCommand)invocation);
+ return invoke((ControllerCommand)invocation);
}
- public abstract void invoke(ControllerCommand cmd) throws Exception, InvocationException;
+ public abstract Object invoke(ControllerCommand cmd) throws Exception, InvocationException;
}
Modified: trunk/core/src/main/org/jboss/portal/core/controller/CoreController.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/CoreController.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/controller/CoreController.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -189,10 +189,10 @@
try
{
// Execute command
- controllerContext.execute(cmd);
+ Object response = controllerContext.execute(cmd);
// Handle the result
- forward = handleResult(cmd, invocation);
+ forward = handleResult(cmd, response, invocation);
}
catch (CommandRedirectionException e)
{
@@ -265,11 +265,8 @@
/**
*
*/
- private Forward handleResult(ControllerCommand cmd, ServerInvocation invocation) throws IOException, ServletException, ServerException
+ private Forward handleResult(ControllerCommand cmd, Object response, ServerInvocation invocation) throws IOException, ServletException, ServerException
{
- // Get response
- Object response = cmd.getResponse();
-
if (response instanceof PageRendition)
{
PageRendition rendition = (PageRendition)response;
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -38,15 +38,15 @@
public class AjaxInterceptor extends ControllerInterceptor
{
- public void invoke(ControllerCommand cmd) throws Exception, InvocationException
+ public Object invoke(ControllerCommand cmd) throws Exception, InvocationException
{
- cmd.invokeNext();
+ Object response = cmd.invokeNext();
//
if (cmd instanceof RenderPageCommand)
{
RenderPageCommand rpc = (RenderPageCommand)cmd;
- PageRendition rendition = (PageRendition)rpc.getResponse();
+ PageRendition rendition = (PageRendition)response;
// Configure ajax
if (rendition != null)
@@ -79,5 +79,8 @@
pageProps.put(ThemeConstants.PORTAL_AJAX_REMOTE_URL, url.toString());
}
}
+
+ //
+ return response;
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/InvokeWindowActionCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/InvokeWindowActionCommand.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/InvokeWindowActionCommand.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -36,6 +36,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.server.ServerInvocation;
/**
@@ -115,10 +116,10 @@
PortletInvocation invocation = actionCtx.createInvocation();
//
- instance.invoke(invocation);
+ PortletInvocationResponse resp = instance.invoke(invocation);
//
- return new PortletResponse(targetId, invocation.getResponse());
+ return new PortletResponse(targetId, resp);
}
catch (PortletInvokerException e)
{
Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/RenderPageCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/RenderPageCommand.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/RenderPageCommand.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -394,12 +394,9 @@
RenderWindowCommand renderCmd = new RenderWindowCommand(windowRef);
//
- context.execute(renderCmd);
+ PortletResponse pr = (PortletResponse)context.execute(renderCmd);
//
- PortletResponse pr = (PortletResponse)renderCmd.getResponse();
-
- //
PortletInvocationResponse pir = pr.getResult();
//
Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/RenderWindowCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/RenderWindowCommand.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/RenderWindowCommand.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -34,6 +34,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.theme.navigation.WindowNavigationalState;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
@@ -90,10 +91,10 @@
//
try
{
- instance.invoke(invocation);
+ PortletInvocationResponse resp = instance.invoke(invocation);
//
- return new PortletResponse(targetId, invocation.getResponse());
+ return new PortletResponse(targetId, resp);
}
catch (PortletInvokerException e)
{
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/InstanceImpl.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -26,6 +26,7 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.StatefulPortletContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.AccessMode;
@@ -218,7 +219,7 @@
return invoker.getProperties(portletContext, keys);
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
boolean debug = getLogger().isDebugEnabled();
PersistentInstanceContainer container = this.containerContext.container;
@@ -244,7 +245,7 @@
invocation.setInstanceContext(instanceContext);
// Perform invocation
- container.invoke(invocation);
+ PortletInvocationResponse response = container.invoke(invocation);
// Create user instance if a clone operation occured
if (instanceContext.accessMode == AccessMode.CLONE_BEFORE_WRITE)
@@ -279,6 +280,9 @@
// Does not make sense
}
}
+
+ //
+ return response;
}
finally
{
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/instance/PersistentInstanceContainer.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/instance/PersistentInstanceContainer.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/instance/PersistentInstanceContainer.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -35,6 +35,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.state.DestroyCloneFailure;
import org.jboss.portal.security.PortalPermission;
import org.jboss.portal.security.PortalPermissionCollection;
@@ -105,13 +106,13 @@
/** . */
protected InvocationHandler handler = new InvocationHandler()
{
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
PortletInvocation portletInvocation = (PortletInvocation)invocation;
try
{
portletInvocation.setHandler(null);
- portletInvoker.invoke(portletInvocation);
+ return portletInvoker.invoke(portletInvocation);
}
finally
{
@@ -379,13 +380,13 @@
return session.createQuery("from InstanceDefinitionImpl").list();
}
- void invoke(PortletInvocation invocation) throws PortletInvokerException
+ PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
InvocationHandler prevHandler = invocation.getHandler();
try
{
invocation.setHandler(handler);
- invocation.invoke(stackFactory.getInterceptorStack());
+ return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
}
catch (Exception e)
{
Modified: trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/ProducerPortletInvoker.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/ProducerPortletInvoker.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/impl/portlet/state/ProducerPortletInvoker.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.common.invocation.InvocationException;
import java.util.List;
@@ -44,8 +45,8 @@
{
return super.destroyClones(portletIds);
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
{
- super.invoke(invocation);
+ return super.invoke(invocation);
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/Instance.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -26,6 +26,7 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import java.util.Set;
@@ -63,7 +64,7 @@
*
* @param invocation the invocation
*/
- void invoke(PortletInvocation invocation) throws PortletInvokerException;
+ PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException;
/**
* Return the instance preferences.
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -26,6 +26,7 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.security.PortalSecurityException;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
@@ -62,7 +63,7 @@
this.pamf = portalAuthorizationManagerFactory;
}
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
try
{
@@ -76,11 +77,11 @@
}
if (!authorized)
{
- invocation.setResponse(new InsufficientPrivilegesResponse());
+ return new InsufficientPrivilegesResponse();
}
else
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
}
catch (PortalSecurityException e)
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/instance/InstanceContainerTestCase.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -35,6 +35,7 @@
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.test.framework.embedded.DataSourceSupport;
import org.jboss.portal.test.framework.embedded.HibernateSupport;
import org.jboss.portal.common.junit.TransactionAssert;
@@ -103,12 +104,12 @@
this.info.getMetaSupport().setDisplayName("Foo");
}
- public void invoke(PortletInvocation invocation)
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
{
this.invocation = invocation;
try
{
- execute();
+ return execute();
}
finally
{
@@ -116,8 +117,9 @@
}
}
- public void execute()
+ public PortletInvocationResponse execute()
{
+ return null;
}
public void setProperty(String key, String value) throws IllegalStateException
@@ -368,15 +370,15 @@
this.terminator = terminator;
}
- public abstract void execute(TestPortletSupport portlet);
+ public abstract PortletInvocationResponse execute(TestPortletSupport portlet);
public void execute() throws Exception
{
portletContainer.addPortlet("MyPortlet", new TestPortletSupport()
{
- public void execute()
+ public PortletInvocationResponse execute()
{
- TestCloneBeforeWrite.this.execute(this);
+ return TestCloneBeforeWrite.this.execute(this);
}
});
String popId = getSinglePOP().getContext().getId();
@@ -427,7 +429,7 @@
{
TestCloneBeforeWrite test = new TestCloneBeforeWrite(null, false, false, TransactionAssert.MUST_COMMIT)
{
- public void execute(TestPortletSupport portlet)
+ public PortletInvocationResponse execute(TestPortletSupport portlet)
{
try
{
@@ -437,6 +439,7 @@
catch (IllegalStateException expected)
{
}
+ return null;
}
};
test.execute();
@@ -458,7 +461,7 @@
{
TestCloneBeforeWrite test = new TestCloneBeforeWrite(null, true, false, TransactionAssert.MUST_COMMIT)
{
- public void execute(TestPortletSupport portlet)
+ public PortletInvocationResponse execute(TestPortletSupport portlet)
{
try
{
@@ -468,6 +471,7 @@
catch (IllegalStateException expected)
{
}
+ return null;
}
};
test.execute();
@@ -489,9 +493,10 @@
{
TestCloneBeforeWrite test = new TestCloneBeforeWrite("julien", false, false, TransactionAssert.MUST_COMMIT)
{
- public void execute(TestPortletSupport portlet)
+ public PortletInvocationResponse execute(TestPortletSupport portlet)
{
portlet.setProperty("abc", "def");
+ return null;
}
};
test.execute();
@@ -525,9 +530,10 @@
{
TestCloneBeforeWrite test = new TestCloneBeforeWrite("julien", true, false, TransactionAssert.MUST_COMMIT)
{
- public void execute(TestPortletSupport portlet)
+ public PortletInvocationResponse execute(TestPortletSupport portlet)
{
portlet.setProperty("abc", "def");
+ return null;
}
};
test.execute();
@@ -563,9 +569,10 @@
{
TestCloneBeforeWrite test = new TestCloneBeforeWrite("julien", false, false, TransactionAssert.MUST_ROLLBACK)
{
- public void execute(TestPortletSupport portlet)
+ public PortletInvocationResponse execute(TestPortletSupport portlet)
{
portlet.setProperty("abc", "def");
+ return null;
}
};
test.execute();
@@ -586,9 +593,10 @@
{
TestCloneBeforeWrite test = new TestCloneBeforeWrite("julien", true, false, TransactionAssert.MUST_ROLLBACK)
{
- public void execute(TestPortletSupport portlet)
+ public PortletInvocationResponse execute(TestPortletSupport portlet)
{
portlet.setProperty("abc", "def");
+ return null;
}
};
test.execute();
@@ -609,7 +617,7 @@
{
TestCloneBeforeWrite test = new TestCloneBeforeWrite("julien", false, true, TransactionAssert.MARKED_AS_ROLLBACK)
{
- public void execute(TestPortletSupport portlet)
+ public PortletInvocationResponse execute(TestPortletSupport portlet)
{
portlet.setProperty("abc", "def");
throw new RuntimeException("custom_message");
@@ -633,7 +641,7 @@
{
TestCloneBeforeWrite test = new TestCloneBeforeWrite("julien", true, true, TransactionAssert.MARKED_AS_ROLLBACK)
{
- public void execute(TestPortletSupport portlet)
+ public PortletInvocationResponse execute(TestPortletSupport portlet)
{
portlet.setProperty("abc", "def");
throw new RuntimeException("custom_message");
@@ -654,9 +662,10 @@
{
portletContainer.addPortlet("MyPortlet", new TestPortletSupport()
{
- public void execute()
+ public PortletInvocationResponse execute()
{
setProperty("abc", "def");
+ return null;
}
});
Modified: trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/core/src/main/org/jboss/portal/test/core/state/ProducerTestCase.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -44,6 +44,7 @@
import org.jboss.portal.Mode;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.state.producer.ProducerState;
import org.jboss.portal.portlet.state.producer.ProducerStateContext;
import org.jboss.portal.portlet.state.AbstractPropertyContext;
@@ -159,10 +160,11 @@
PreferencesInfoSupport prefs = info.getPreferencesSupport();
prefs.addPreference("abc", new StringValue("def"));
}
- public void invoke(PortletInvocation invocation)
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
{
AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
+ return null;
}
});
@@ -172,10 +174,11 @@
PreferencesInfoSupport prefs = info.getPreferencesSupport();
prefs.addPreference("abc", new StringValue("def"));
}
- public void invoke(PortletInvocation invocation)
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
{
AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
+ return null;
}
});
@@ -185,7 +188,7 @@
PreferencesInfoSupport prefs = info.getPreferencesSupport();
prefs.addPreference("abc", new StringValue("def"));
}
- public void invoke(PortletInvocation invocation)
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
{
try
{
@@ -196,6 +199,7 @@
catch (IllegalStateException expected)
{
}
+ return null;
}
});
@@ -205,7 +209,7 @@
PreferencesInfoSupport prefs = info.getPreferencesSupport();
prefs.addPreference("abc", new StringValue("def"));
}
- public void invoke(PortletInvocation invocation)
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
{
AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("_abc", new StringValue("_def"))});
Modified: trunk/federation/src/main/org/jboss/portal/federation/impl/FederatedPortletInvokerService.java
===================================================================
--- trunk/federation/src/main/org/jboss/portal/federation/impl/FederatedPortletInvokerService.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/federation/src/main/org/jboss/portal/federation/impl/FederatedPortletInvokerService.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.StatefulPortletContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AccessMode;
import org.jboss.portal.portlet.state.DestroyCloneFailure;
@@ -143,7 +144,7 @@
}
}
- public void invoke(PortletInvocation invocation) throws InvocationException, PortletInvokerException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws InvocationException, PortletInvokerException
{
PortletContext compoundPortletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
PortletContext portletContext = dereference(compoundPortletContext);
@@ -152,7 +153,7 @@
{
invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, portletContext);
invocation.setInstanceContext(new FederatedInstanceContext(instanceContext));
- portletInvoker.invoke(invocation);
+ return portletInvoker.invoke(invocation);
}
finally
{
Modified: trunk/federation/src/main/org/jboss/portal/federation/impl/FederatingPortletInvokerService.java
===================================================================
--- trunk/federation/src/main/org/jboss/portal/federation/impl/FederatingPortletInvokerService.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/federation/src/main/org/jboss/portal/federation/impl/FederatingPortletInvokerService.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import java.util.HashMap;
@@ -152,11 +153,11 @@
return new FederatedPortlet(compoundPortletContext, portlet);
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
PortletContext compoundPortletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
FederatedPortletInvoker federated = getFederatedPortletInvokerFor(compoundPortletContext);
- federated.invoke(invocation);
+ return federated.invoke(invocation);
}
public PortletContext createClone(PortletContext compoundPortletContext) throws PortletInvokerException
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/PortletInvoker.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -27,6 +27,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import java.util.List;
import java.util.Set;
@@ -57,9 +58,10 @@
* Invoke an operation on a specific portlet.
*
* @param invocation the portlet invocation
+ * @return the invocatin response
* @throws IllegalArgumentException if the invocation is null
*/
- void invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException;
+ PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException;
/**
* Clone a portlet.
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -22,12 +22,12 @@
package org.jboss.portal.portlet.aspects.portlet;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.util.Exceptions;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.RequestContext;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.server.servlet.CommandServlet;
@@ -51,9 +51,9 @@
public static final String REQ_ATT_COMPONENT_INVOCATION = "org.jboss.portal.attribute.component_invocation";
- private static final ThreadLocal localEx = new ThreadLocal();
+ private static final ThreadLocal localResponse = new ThreadLocal();
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
PortletContainer container = ((ContainerPortletInfo)invocation.getInfo()).getContainer();
PortletApplication portletApplication = container.getApplication();
@@ -75,11 +75,17 @@
CommandServlet.include(dispatcher, cmd, targetCtx);
// Rethrow any InvocationException
- Exception ex = (Exception)localEx.get();
- if (ex != null)
+ Object response = localResponse.get();
+
+ //
+ if (response instanceof Exception)
{
- throw ex;
+ throw (Exception)response;
}
+ else
+ {
+ return response;
+ }
}
catch (IOException e)
{
@@ -107,7 +113,7 @@
}
finally
{
- localEx.set(null);
+ localResponse.set(null);
}
}
@@ -138,11 +144,14 @@
//
try
{
- invocation.invokeNext();
+ PortletInvocationResponse response = (PortletInvocationResponse)invocation.invokeNext();
+
+ //
+ localResponse.set(response);
}
catch (Exception e)
{
- localEx.set(e);
+ localResponse.set(e);
}
}
finally
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -35,7 +35,7 @@
*/
public class ContextTrackerInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
//
String contextPath = (String)invocation.getDispatchedRequest().getAttribute("javax.servlet.include.context_path");
@@ -44,6 +44,6 @@
org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.getSet().add(contextPath);
// Invoke next command
- invocation.invokeNext();
+ return invocation.invokeNext();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -44,7 +44,7 @@
public class ModesInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
if ((invocation.getPortletContext()).getMode() == null)
{
@@ -58,7 +58,7 @@
invocation.setSupportedModes(modes);
// Continue the invocation
- invocation.invokeNext();
+ return invocation.invokeNext();
}
/**
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortalSessionSynchronizationInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -39,7 +39,7 @@
*/
public class PortalSessionSynchronizationInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
HttpServletRequest req = null;
@@ -83,7 +83,7 @@
}
//
- invocation.invokeNext();
+ return invocation.invokeNext();
}
finally
{
@@ -108,7 +108,7 @@
}
else
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/PortletSessionSynchronizationInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -38,7 +38,7 @@
*/
public class PortletSessionSynchronizationInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
PortletInfo portletInfo = invocation.getInfo();
SessionInfo sessionInfo = portletInfo.getSession();
@@ -61,7 +61,7 @@
SessionListener.activate();
//
- invocation.invokeNext();
+ return invocation.invokeNext();
}
finally
{
@@ -74,7 +74,7 @@
}
else
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -37,20 +37,19 @@
*/
public class ProducerCacheInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
if (invocation instanceof ActionInvocation)
{
// Invoke
- invocation.invokeNext();
+ return invocation.invokeNext();
}
else if (invocation instanceof RenderInvocation)
{
// Invoke
- invocation.invokeNext();
+ PortletInvocationResponse response = (PortletInvocationResponse)invocation.invokeNext();
//
- PortletInvocationResponse response = invocation.getResponse();
if (response instanceof FragmentResponse)
{
FragmentResponse fragmentResult = (FragmentResponse)response;
@@ -62,6 +61,9 @@
// Update the fragment cache info
fragmentResult.setExpirationSecs(cacheInfo.getExpirationSecs());
}
+
+ //
+ return response;
}
else
{
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -40,7 +40,7 @@
public class SecureTransportInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
PortletInfo containerInfo = invocation.getInfo();
SecurityInfo securityInfo = containerInfo.getSecurity();
@@ -62,12 +62,12 @@
if (invoke)
{
// Invoke
- invocation.invokeNext();
+ return invocation.invokeNext();
}
else
{
// Significate to the caller that this component should be executed with an higher security level
- invocation.setResponse(new InsufficientTransportGuaranteeResponse());
+ return new InsufficientTransportGuaranteeResponse();
}
}
}
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 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -48,7 +48,7 @@
*/
public class ValveInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
PortletContainer container = ((ContainerPortletInfo)invocation.getInfo()).getContainer();
Valve valve = container.getValve();
@@ -56,9 +56,11 @@
// Try to aquire the valve
if (valve.beforeInvocation())
{
+ PortletInvocationResponse response = null;
+
try
{
- invocation.invokeNext();
+ response = (PortletInvocationResponse)invocation.invokeNext();
}
finally
{
@@ -67,7 +69,6 @@
}
// Stop the container if necessary
- PortletInvocationResponse response = invocation.getResponse();
if (response instanceof UnavailableResponse)
{
// This call will wait until all the current threads have exited the component valve.
@@ -76,11 +77,13 @@
PortletApplicationImpl pwa = (PortletApplicationImpl)container.getApplication();
pwa.stop(container.getName());
}
+
+ //
+ return response;
}
else
{
- UnavailableResponse res = new UnavailableResponse();
- invocation.setResponse(res);
+ return new UnavailableResponse();
}
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -38,7 +38,7 @@
public class WindowStatesInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
if (invocation.getPortletContext().getWindowState() == null)
{
@@ -52,7 +52,7 @@
invocation.setSupportedWindowStates(windowStates);
// Continue the invocation
- invocation.invokeNext();
+ return invocation.invokeNext();
}
/**
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -424,19 +424,17 @@
}
}
- public void dispatch(PortletInvocation invocation) throws PortletInvokerException, InvocationException
+ public PortletInvocationResponse dispatch(PortletInvocation invocation) throws PortletInvokerException, InvocationException
{
try
{
if (invocation instanceof ActionInvocation)
{
- PortletInvocationResponse response = invokeAction((ActionInvocation)invocation);
- invocation.setResponse(response);
+ return invokeAction((ActionInvocation)invocation);
}
else if (invocation instanceof RenderInvocation)
{
- PortletInvocationResponse response = invokeRender((RenderInvocation)invocation);
- invocation.setResponse(response);
+ return invokeRender((RenderInvocation)invocation);
}
else
{
@@ -446,7 +444,7 @@
catch (NoClassDefFoundError e)
{
//
- invocation.setResponse(new ErrorResponse(e));
+ return new ErrorResponse(e);
}
catch (Exception e)
{
@@ -455,24 +453,24 @@
//
if (e instanceof PortletSecurityException)
{
- invocation.setResponse(new SecurityErrorResponse(e));
+ return new SecurityErrorResponse(e);
}
else if (e instanceof UnavailableException)
{
UnavailableException ue = (UnavailableException)e;
if (ue.isPermanent())
{
- invocation.setResponse(new UnavailableResponse());
+ return new UnavailableResponse();
}
else
{
- invocation.setResponse(new UnavailableResponse(ue.getUnavailableSeconds()));
+ return new UnavailableResponse(ue.getUnavailableSeconds());
}
}
else
{
// The exception is either a PortletException, an IOException or a RuntimeException
- invocation.setResponse(new ErrorResponse(e));
+ return new ErrorResponse(e);
}
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -34,6 +34,7 @@
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.container.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import java.util.Set;
@@ -60,7 +61,7 @@
/** . */
private InvocationHandler handler = new InvocationHandler()
{
- public void invoke(Invocation invocation) throws Exception, org.jboss.portal.common.invocation.InvocationException
+ public Object invoke(Invocation invocation) throws Exception, org.jboss.portal.common.invocation.InvocationException
{
PortletInvocation portletInvocation = (PortletInvocation)invocation;
try
@@ -68,7 +69,7 @@
portletInvocation.setHandler(null);
ContainerPortletInfo info = (ContainerPortletInfo)portletInvocation.getInfo();
PortletContainer container = info.getContainer();
- container.dispatch(portletInvocation);
+ return container.dispatch(portletInvocation);
}
finally
{
@@ -128,13 +129,13 @@
return container;
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
{
InvocationHandler prevHandler = invocation.getHandler();
try
{
invocation.setHandler(handler);
- invocation.invoke(stackFactory.getInterceptorStack());
+ return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
}
catch (Exception e)
{
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -24,6 +24,7 @@
import org.jboss.portal.common.invocation.Invocation;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.server.impl.invocation.JBossInterceptor;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
@@ -32,10 +33,10 @@
public abstract class PortletInterceptor extends JBossInterceptor
{
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
- invoke((PortletInvocation)invocation);
+ return invoke((PortletInvocation)invocation);
}
- protected abstract void invoke(PortletInvocation invocation) throws Exception, InvocationException;
+ protected abstract Object invoke(PortletInvocation invocation) throws Exception, InvocationException;
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -102,12 +102,12 @@
/** The dispatched response. */
protected HttpServletResponse dresp;
- /** The result. */
- protected PortletInvocationResponse response;
-
/** The invocation context. */
protected PortletInvocationContext ctx;
+ /** Temporarily here. */
+ private PortletInvocationResponse response;
+
/**
* Create an invocation to a portlet.
*/
@@ -172,22 +172,6 @@
}
/**
- * Set the outcome of this request.
- */
- public void setResponse(PortletInvocationResponse response)
- {
- this.response = response;
- }
-
- /**
- * Return the outcome of this request.
- */
- public PortletInvocationResponse getResponse()
- {
- return response;
- }
-
- /**
* Return the dispatched http servlet request.
*/
public HttpServletResponse getDispatchedResponse()
@@ -278,4 +262,14 @@
{
this.windowContext = windowContext;
}
+
+ public PortletInvocationResponse getResponse()
+ {
+ return response;
+ }
+
+ public void setResponse(PortletInvocationResponse response)
+ {
+ this.response = response;
+ }
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.StatefulPortletContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AccessMode;
import org.jboss.portal.portlet.state.InvalidStateIdException;
@@ -131,7 +132,7 @@
return producer.getPortlet(cpc.portletContext);
}
- public void invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
AttributeResolver resolver = invocation.getContext().getAttributeResolver(PortletInvocation.REQUEST_SCOPE);
if (resolver == null)
@@ -158,7 +159,7 @@
invocation.setInstanceContext(pictx);
//
- producer.invoke(invocation);
+ PortletInvocationResponse response = producer.invoke(invocation);
//
if (pictx.clonedContext != null)
@@ -200,6 +201,9 @@
}
}
}
+
+ //
+ return response;
}
finally
{
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -36,6 +36,7 @@
import org.jboss.portal.portlet.info.PreferencesInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AbstractPropertyContext;
import org.jboss.portal.portlet.state.AccessMode;
@@ -175,7 +176,7 @@
}
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException, InvocationException
{
// Get the context of the portlet that the client want to use
final PortletContext portletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
@@ -225,6 +226,7 @@
AbstractPropertyContext prefs = new AbstractPropertyContext(access, propertyMap, prefsInfo);
//
+ PortletInvocationResponse response;
try
{
invocation.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, new PortletContext(targetPortletId));
@@ -232,7 +234,7 @@
invocation.setInfo(info);
// Invoke
- portletInvoker.invoke(invocation);
+ response = portletInvoker.invoke(invocation);
}
finally
{
@@ -344,6 +346,9 @@
throw new InvocationException("Read only portlet should have not been modified");
}
}
+
+ //
+ return response;
}
public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -153,8 +153,7 @@
ActionInvocation action = createAction(invocation, actionContext);
action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, ((InstanceContextImpl)action.getInstanceContext()).getPortletContext());
- portletInvoker.invoke(action);
- PortletInvocationResponse response = action.getResponse();
+ PortletInvocationResponse response = portletInvoker.invoke(action);
if (response instanceof RenderResponse)
{
RenderResponse renderResult = (RenderResponse)response;
@@ -284,12 +283,9 @@
writer.write("<div>");
RenderInvocation render = createRender(invocation, renderContext);
render.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, ((InstanceContextImpl)render.getInstanceContext()).getPortletContext());
- portletInvoker.invoke(render);
+ PortletInvocationResponse response = portletInvoker.invoke(render);
//
-
-
- PortletInvocationResponse response = render.getResponse();
if (response instanceof FragmentResponse)
{
FragmentResponse fragment = (FragmentResponse)response;
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortletInvoker.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import java.util.Set;
@@ -55,13 +56,13 @@
/** . */
private InvocationHandler handler = new InvocationHandler()
{
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
PortletInvocation portletInvocation = (PortletInvocation)invocation;
try
{
portletInvocation.setHandler(null);
- producer.invoke(portletInvocation);
+ return producer.invoke(portletInvocation);
}
finally
{
@@ -100,13 +101,13 @@
return producer.getPortlet(portletContext);
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
InvocationHandler prevHandler = invocation.getHandler();
try
{
invocation.setHandler(handler);
- invocation.invoke(stackFactory.getInterceptorStack());
+ return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
}
catch (Exception e)
{
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -24,8 +24,10 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.security.PortletPermission;
import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
@@ -53,7 +55,7 @@
this.pamf = portalAuthorizationManagerFactory;
}
- protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
+ protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
try
{
@@ -64,17 +66,16 @@
boolean authorized = authMgr.checkPermission(perm);
if (authorized == false)
{
- InsufficientPrivilegesResponse result = new InsufficientPrivilegesResponse();
- invocation.setResponse(result);
+ return new InsufficientPrivilegesResponse();
}
else
{
- invocation.invokeNext();
+ return invocation.invokeNext();
}
}
catch (PortalSecurityException e)
{
- e.printStackTrace();
+ throw new PortletInvokerException(e);
}
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletInvokerSupport.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import java.util.Map;
@@ -111,11 +112,11 @@
return internalGetPortlet(portletContext);
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
PortletContext portletContext = (PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE);
InternalPortlet portlet = internalGetPortlet(portletContext);
- portlet.support.invoke(invocation);
+ return portlet.support.invoke(invocation);
}
private InternalPortlet internalGetPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/support/PortletSupport.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -25,6 +25,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.test.support.info.PortletInfoSupport;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.info.PortletInfo;
/**
@@ -60,7 +61,7 @@
return info;
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
throw new PortletInvokerException("No implementations");
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/state/AbstractStatefulPortletInvokerTestCase.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -36,6 +36,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.common.util.LocalizedString;
@@ -696,10 +697,11 @@
info.getPreferencesSupport().addPreference("abc", new StringValue("def"));
PortletSupport portletSupport = new PortletSupport(info)
{
- public void invoke(PortletInvocation invocation)
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
{
AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
+ return null;
}
};
Object popCtx = createPOPRef(portletSupport);
@@ -727,16 +729,18 @@
info.getPreferencesSupport().addPreference("abc", new StringValue("def"));
PortletSupport portletSupport = new PortletSupport(info)
{
- public void invoke(PortletInvocation invocation)
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
{
try
{
AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
+ return null;
}
catch (IllegalStateException e)
{
ise[0] = Boolean.TRUE;
+ return null;
}
}
};
@@ -758,10 +762,11 @@
info.getPreferencesSupport().addPreference("abc", new StringValue("def"));
PortletSupport portletSupport = new PortletSupport(info)
{
- public void invoke(PortletInvocation invocation)
+ public PortletInvocationResponse invoke(PortletInvocation invocation)
{
AbstractPropertyContext props = (AbstractPropertyContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PREFERENCES_ATTRIBUTE);
props.update(new PropertyChange[]{PropertyChange.newUpdate("abc", new StringValue("_def"))});
+ return null;
}
};
Object popCtx = createPOPRef(portletSupport);
Modified: trunk/server/src/main/org/jboss/portal/server/RequestControllerDispatcher.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/RequestControllerDispatcher.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/server/src/main/org/jboss/portal/server/RequestControllerDispatcher.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -44,9 +44,12 @@
this.controller = controller;
}
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
ServerInvocation serverInvocation = (ServerInvocation)invocation;
controller.handle(serverInvocation);
+
+ // For now not used by the server
+ return null;
}
}
Modified: trunk/server/src/main/org/jboss/portal/server/ServerInterceptor.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/ServerInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/server/src/main/org/jboss/portal/server/ServerInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -32,9 +32,12 @@
public abstract class ServerInterceptor extends JBossInterceptor
{
- public void invoke(Invocation invocation) throws Exception, InvocationException
+ public Object invoke(Invocation invocation) throws Exception, InvocationException
{
invoke((ServerInvocation)invocation);
+
+ // For now not used by the server
+ return null;
}
protected abstract void invoke(ServerInvocation invocation) throws Exception, InvocationException;
Modified: trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInterceptor.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/server/src/main/org/jboss/portal/server/impl/invocation/JBossInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -40,5 +40,5 @@
return this;
}
- public abstract void invoke(Invocation invocation) throws Exception, InvocationException;
+ public abstract Object invoke(Invocation invocation) throws Exception, InvocationException;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -54,13 +54,15 @@
{
RenderInvocation render = createRenderInvocation(SOF.NULL_MARKUP_PORTLET_HANDLE);
- consumer.invoke(render);
+ // juju - fixme
+ render.setResponse(consumer.invoke(render));
assertTrue(render.getResponse() instanceof ErrorResponse);
render = createRenderInvocation(SOF.EMPTY_MARKUP_PORTLET_HANDLE);
- consumer.invoke(render);
+ // juju - fixme
+ render.setResponse(consumer.invoke(render));
checkRenderResult(render, "");
}
@@ -69,14 +71,16 @@
{
RenderInvocation render = createRenderInvocation(SOF.PORTLET_HANDLE_1);
- consumer.invoke(render);
+ // juju - fixme
+ render.setResponse(consumer.invoke(render));
FragmentResponse result = checkRenderResult(render, "portlet1:view:maximized");
assertEquals(15, result.getExpirationSecs());
render = createRenderInvocation(SOF.PORTLET_HANDLE_2);
- consumer.invoke(render);
+ // juju - fixme
+ render.setResponse(consumer.invoke(render));
result = checkRenderResult(render, "portlet2:0:view:maximized");
assertEquals(0, result.getExpirationSecs());
@@ -91,7 +95,8 @@
action.setUserContext(new BasicUserContext());
action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, new PortletContext(SOF.PORTLET_HANDLE_1));
- consumer.invoke(action);
+ // juju - fixme
+ action.setResponse(consumer.invoke(action));
PortletInvocationResponse response = action.getResponse();
assertNotNull(response);
@@ -101,13 +106,17 @@
RenderInvocation renderInvocation = createRenderInvocation(SOF.PORTLET_HANDLE_1);
((TestPortletInvocationContext)renderInvocation.getContext()).ns = "ns1";
- consumer.invoke(renderInvocation);
+
+ // juju - fixme
+ renderInvocation.setResponse(consumer.invoke(renderInvocation));
checkRenderResult(renderInvocation, "portlet1:view:maximized:ns1");
}
public void testSessionHandling() throws Exception
{
RenderInvocation render = createRenderInvocation(SOF.PORTLET_HANDLE_2);
+ // juju - fixme
+ render.setResponse(consumer.invoke(render));
consumer.invoke(render);
checkRenderResult(render, "portlet2:0:view:maximized");
@@ -120,7 +129,8 @@
assertFalse(sessionInfo.isPerGroupCookies());
assertFalse(sessionInfo.isInitCookieDone());
- consumer.invoke(render);
+ // juju - fixme
+ render.setResponse(consumer.invoke(render));
checkRenderResult(render, "portlet2:1:view:maximized");
}
@@ -132,7 +142,8 @@
HttpSession session = invocationContext.mockRequest.getSession();
producer.setResponse(invocationContext.mockResponse);
- consumer.invoke(render);
+ // juju - fixme
+ render.setResponse(consumer.invoke(render));
ProducerSessionInformation sessionInfo = consumer.getProducerSessionInformationFrom(session);
assertFalse(sessionInfo.isPerGroupCookies());
@@ -145,7 +156,8 @@
session = invocationContext.mockRequest.getSession();
producer.setResponse(invocationContext.mockResponse);
- consumer.invoke(render);
+ // juju - fixme
+ render.setResponse(consumer.invoke(render));
sessionInfo = consumer.getProducerSessionInformationFrom(session);
assertFalse(sessionInfo.isPerGroupCookies());
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/aspects/portlet/DumpInterceptor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/aspects/portlet/DumpInterceptor.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/aspects/portlet/DumpInterceptor.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -33,11 +33,11 @@
*/
public class DumpInterceptor extends PortletInterceptor
{
- protected void invoke(PortletInvocation invocation) throws Exception
+ protected Object invoke(PortletInvocation invocation) throws Exception
{
HttpServletRequest drq = invocation.getDispatchedRequest();
HttpSession session = drq.getSession();
System.out.println("DumpInterceptor: session.getId() = " + session.getId());
- invocation.invokeNext();
+ return invocation.invokeNext();
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -32,6 +32,7 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.wsrp.UserContextConverter;
@@ -183,7 +184,7 @@
return portlet;
}
- public void invoke(PortletInvocation invocation) throws PortletInvokerException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
InvocationHandler handler;
@@ -201,6 +202,9 @@
}
handler.handle(invocation);
+
+ // juju - fixme
+ return invocation.getResponse();
}
public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2006-10-11 21:03:41 UTC (rev 5425)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2006-10-11 22:17:42 UTC (rev 5426)
@@ -194,7 +194,8 @@
try
{
log.debug("RenderInvocation on portlet '" + portletHandle + "'");
- producer.getInvoker().invoke(render);
+ // juju - fixme
+ render.setResponse(producer.getInvoker().invoke(render));
log.debug("RenderInvocation done");
}
catch (PortletInvokerException e)
@@ -366,7 +367,8 @@
try
{
log.debug("ActionInvocation on portlet '" + portletHandle + "'");
- producer.getInvoker().invoke(invocation);
+ // juju - fixme
+ invocation.setResponse(producer.getInvoker().invoke(invocation));
log.debug("ActionInvocation done");
}
catch (PortletInvokerException e)
More information about the jboss-svn-commits
mailing list