JBoss Portal SVN: r10597 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet: spi and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-04-15 19:51:51 -0400 (Tue, 15 Apr 2008)
New Revision: 10597
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java
Log:
PortletInvocationContext do no need to extends InvocationContext anymore.
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2008-04-15 23:45:45 UTC (rev 10596)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2008-04-15 23:51:51 UTC (rev 10597)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.spi;
-import org.jboss.portal.common.invocation.AbstractInvocationContext;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.ContainerURL;
import org.jboss.portal.portlet.URLFormat;
@@ -39,7 +38,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5064 $
*/
-public abstract class AbstractPortletInvocationContext extends AbstractInvocationContext implements PortletInvocationContext
+public abstract class AbstractPortletInvocationContext implements PortletInvocationContext
{
/** . */
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2008-04-15 23:45:45 UTC (rev 10596)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2008-04-15 23:51:51 UTC (rev 10597)
@@ -25,7 +25,6 @@
import java.io.IOException;
import java.io.Writer;
-import org.jboss.portal.common.invocation.InvocationContext;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.ContainerURL;
import org.jboss.portal.portlet.URLFormat;
@@ -36,7 +35,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5064 $
*/
-public interface PortletInvocationContext extends InvocationContext
+public interface PortletInvocationContext
{
/**
18 years
JBoss Portal SVN: r10596 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-04-15 19:45:45 -0400 (Tue, 15 Apr 2008)
New Revision: 10596
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvokerInterceptor.java
Log:
a bit of javadoc
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvokerInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvokerInterceptor.java 2008-04-15 23:38:46 UTC (rev 10595)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvokerInterceptor.java 2008-04-15 23:45:45 UTC (rev 10596)
@@ -35,6 +35,12 @@
import java.util.List;
/**
+ * A base class for {@link org.jboss.portal.portlet.PortletInvoker} interface interceptors. The subclasses
+ * extends it and override the intercepted methods. The next interceptor in the chain is wired in the field
+ * {@link #next} of the interceptor. When the interceptor wants to give control to the next interceptor, it must
+ * invoke the same method on the super class. If no next interceptor is configured the invocation of the parent
+ * method will throw an {@link IllegalStateException}.
+ *
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
18 years
JBoss Portal SVN: r10595 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-04-15 19:38:46 -0400 (Tue, 15 Apr 2008)
New Revision: 10595
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor.java
Log:
remove now useless PortletInterceptor
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor.java 2008-04-15 23:38:46 UTC (rev 10595)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.invocation;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6712 $
- */
-public abstract class PortletInterceptor
-{
-}
18 years
JBoss Portal SVN: r10594 - in modules/portlet/trunk: management/src/main/java/org/jboss/portal/portlet/management and 11 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-04-15 19:34:57 -0400 (Tue, 15 Apr 2008)
New Revision: 10594
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvokerInterceptor.java
Removed:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/TestPortletInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/TestPortletInvoker.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java
Modified:
modules/portlet/trunk/bridge/src/main/java/org/jboss/portal/portlet/bridge/BridgeInterceptor.java
modules/portlet/trunk/management/src/main/java/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/CCPPInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/EventPayloadInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/PortletCustomizationInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/RequestAttributeConversationInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/ContainerPortletInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
Log:
migrate portlet container interceptor to use the unified portlet invoker interceptors
Modified: modules/portlet/trunk/bridge/src/main/java/org/jboss/portal/portlet/bridge/BridgeInterceptor.java
===================================================================
--- modules/portlet/trunk/bridge/src/main/java/org/jboss/portal/portlet/bridge/BridgeInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/bridge/src/main/java/org/jboss/portal/portlet/bridge/BridgeInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,8 +22,10 @@
******************************************************************************/
package org.jboss.portal.portlet.bridge;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.PortletInvokerException;
/**
* The bridge interceptor set the bridge for the duration of the request made to the portlet.
@@ -31,10 +33,10 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6549 $
*/
-public class BridgeInterceptor extends PortletInterceptor
+public class BridgeInterceptor extends PortletInvokerInterceptor
{
- protected Object invoke(PortletInvocation invocation) throws Exception
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
JBossServletContextProvider.BridgeInfo previousInfo = JBossServletContextProvider.get();
try
@@ -44,7 +46,7 @@
JBossServletContextProvider.set(bridgeInfo);
// Proceed to invocation
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
finally
{
Modified: modules/portlet/trunk/management/src/main/java/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java
===================================================================
--- modules/portlet/trunk/management/src/main/java/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/management/src/main/java/org/jboss/portal/portlet/management/PortletContainerManagementInterceptorImpl.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,75 +22,73 @@
******************************************************************************/
package org.jboss.portal.portlet.management;
-import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
-import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
*/
-public class PortletContainerManagementInterceptorImpl extends PortletInterceptor implements PortletContainerManagementInterceptor
+public class PortletContainerManagementInterceptorImpl extends PortletInvokerInterceptor implements PortletContainerManagementInterceptor
{
- private Map map = new ConcurrentHashMap();
+ /** . */
+ private final ConcurrentMap<String, PortletInfo> map = new ConcurrentHashMap<String, PortletInfo>();
// Correctness is not insured.
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
PortletContext portlet = invocation.getTarget();
String portletName = portlet.getId();
- boolean error = false;
-
+ boolean error = true;
long delta = - System.currentTimeMillis();
- Object object;
+
+ //
try
{
- object = invocation.invokeNext();
+ PortletInvocationResponse response = super.invoke(invocation);
+ error = false;
+ return response;
}
- catch (InvocationException e)
+ finally
{
- error = true;
- throw e;
- }
- catch (Exception e)
- {
- error = true;
- throw e;
- }
+ delta += System.currentTimeMillis();
- delta += System.currentTimeMillis();
-
- if (invocation instanceof RenderInvocation)
- {
- PortletInfo info = getPortletInfo(portletName);
- info.newRenderCall(delta, error);
+ //
+ if (invocation instanceof RenderInvocation)
+ {
+ PortletInfo info = getPortletInfo(portletName);
+ info.newRenderCall(delta, error);
+ }
+ else if (invocation instanceof ActionInvocation)
+ {
+ PortletInfo info = getPortletInfo(portletName);
+ info.newActionCall(delta, error);
+ }
}
- else if (invocation instanceof ActionInvocation)
- {
- PortletInfo info = getPortletInfo(portletName);
- info.newActionCall(delta, error);
- }
- return object;
}
public synchronized PortletInfo getPortletInfo(String key)
{
- PortletInfo info = (PortletInfo)map.get(key);
+ PortletInfo info = map.get(key);
+
+ //
if (info == null)
{
- info = new PortletInfo();
- map.put(key, info);
+ info = map.putIfAbsent(key, new PortletInfo());
}
+
+ //
return info;
}
-
}
Deleted: modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/TestPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/TestPortletInvoker.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/TestPortletInvoker.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -1,159 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.portlet.portal;
-
-import org.jboss.portal.common.invocation.InterceptorStackFactory;
-import org.jboss.portal.common.invocation.Invocation;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.invocation.InvocationHandler;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-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.portlet.state.PropertyChange;
-import org.jboss.portal.portlet.state.PropertyMap;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * A simple consumer.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6712 $
- */
-public class TestPortletInvoker implements PortletInvoker
-{
-
- /** . */
- private InterceptorStackFactory stackFactory;
-
- /** . */
- private PortletInvoker producer;
-
- /** . */
- private InvocationHandler handler = new InvocationHandler()
- {
- public Object invoke(Invocation invocation) throws Exception, InvocationException
- {
- PortletInvocation portletInvocation = (PortletInvocation)invocation;
- try
- {
- portletInvocation.setHandler(null);
- return producer.invoke(portletInvocation);
- }
- finally
- {
- portletInvocation.setHandler(this);
- }
- }
- };
-
- public InterceptorStackFactory getStackFactory()
- {
- return stackFactory;
- }
-
- public void setStackFactory(InterceptorStackFactory stackFactory)
- {
- this.stackFactory = stackFactory;
- }
-
- public PortletInvoker getProducer()
- {
- return producer;
- }
-
- public void setProducer(PortletInvoker producer)
- {
- this.producer = producer;
- }
-
- public Set<Portlet> getPortlets() throws PortletInvokerException
- {
- return producer.getPortlets();
- }
-
- public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
- {
- return producer.getPortlet(portletContext);
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
- {
- InvocationHandler prevHandler = invocation.getHandler();
- try
- {
- invocation.setHandler(handler);
- return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
- }
- catch (Exception e)
- {
- if (e instanceof PortletInvokerException)
- {
- throw (PortletInvokerException)e;
- }
- else if (e instanceof RuntimeException)
- {
- throw (RuntimeException)e;
- }
- else
- {
- throw new PortletInvokerException(e);
- }
- }
- finally
- {
- invocation.setHandler(prevHandler);
- }
- }
-
- public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-}
\ No newline at end of file
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-04-15 23:34:57 UTC (rev 10594)
@@ -40,59 +40,8 @@
</constructor>
</bean>
- <!-- Consumer stack -->
- <bean name="ConsumerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor">
- </bean>
- <bean name="PortletCustomizationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.PortletCustomizationInterceptor">
- </bean>
- <bean name="ConsumerStackFactory" class="org.jboss.portal.portlet.portal.InterceptorStackFactoryImpl">
- <property name="interceptors">
- <array>
- <inject bean="ConsumerCacheInterceptor"/>
- <inject bean="PortletCustomizationInterceptor"/>
- </array>
- </property>
- </bean>
-
- <!-- The consumer portlet invoker -->
- <bean name="ConsumerPortletInvoker" class="org.jboss.portal.portlet.portal.TestPortletInvoker">
- <property name="producer"><inject bean="ProducerPortletInvoker"/></property>
- <property name="stackFactory"><inject bean="ConsumerStackFactory"/></property>
- </bean>
-
- <!-- Container stack -->
- <bean name="ValveInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor"/>
- <bean name="SecureTransportInterceptor" class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor"/>
- <bean name="ContextDispatcherInterceptor"
- class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
- <property name="servletContainerFactory"><inject bean="ServletContainerFactory"/></property>
- </bean>
- <bean name="ProducerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"/>
- <bean name="CCPPInterceptor" class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor"/>
- <bean name="RequestAttributeConversationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor"/>
- <bean name="EventPayloadInterceptor" class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor"/>
- <bean name="ContainerStackFactory" class="org.jboss.portal.portlet.portal.InterceptorStackFactoryImpl">
- <property name="interceptors">
- <array>
- <inject bean="ValveInterceptor"/>
- <inject bean="SecureTransportInterceptor"/>
- <inject bean="ContextDispatcherInterceptor"/>
- <inject bean="ProducerCacheInterceptor"/>
- <inject bean="CCPPInterceptor"/>
- <inject bean="RequestAttributeConversationInterceptor"/>
- <inject bean="EventPayloadInterceptor"/>
- </array>
- </property>
- </bean>
-
- <!-- The portlet container invoker -->
- <bean name="ContainerPortletInvoker" class="org.jboss.portal.portlet.container.ContainerPortletInvoker">
- <property name="stackFactory"><inject bean="ContainerStackFactory"/></property>
- </bean>
-
<!-- The producer persistence manager -->
- <bean name="ProducerPersistenceManager"
- class="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
+ <bean name="ProducerPersistenceManager" class="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
<!-- The producer state management policy -->
<bean name="ProducerStateManagementPolicy" class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
@@ -102,6 +51,17 @@
<!-- The producer state converter -->
<bean name="ProducerStateConverter" class="org.jboss.portal.portlet.impl.state.StateConverterV0"/>
+ <!-- The consumer portlet invoker -->
+ <bean name="ConsumerPortletInvoker" class="org.jboss.portal.portlet.invocation.PortletInvokerInterceptor">
+ <property name="next"><inject bean="ConsumerCacheInterceptor"/></property>
+ </bean>
+ <bean name="ConsumerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor">
+ <property name="next"><inject bean="PortletCustomizationInterceptor"/></property>
+ </bean>
+ <bean name="PortletCustomizationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.PortletCustomizationInterceptor">
+ <property name="next"><inject bean="ProducerPortletInvoker"/></property>
+ </bean>
+
<!-- The producer portlet invoker -->
<bean name="ProducerPortletInvoker" class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
<property name="next"><inject bean="ContainerPortletInvoker"/></property>
@@ -110,4 +70,36 @@
<property name="stateConverter"><inject bean="ProducerStateConverter"/></property>
</bean>
+ <!-- The portlet container invoker -->
+ <bean name="ContainerPortletInvoker" class="org.jboss.portal.portlet.container.ContainerPortletInvoker">
+ <property name="next"><inject bean="ValveInterceptor"/></property>
+ </bean>
+
+ <!-- Container stack -->
+ <bean name="ValveInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor">
+ <property name="portletApplicationRegistry"><inject bean="PortletApplicationRegistry" state="Instantiated"/></property>
+ <property name="next"><inject bean="SecureTransportInterceptor"/></property>
+ </bean>
+ <bean name="SecureTransportInterceptor" class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor">
+ <property name="next"><inject bean="ContextDispatcherInterceptor"/></property>
+ </bean>
+ <bean name="ContextDispatcherInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
+ <property name="servletContainerFactory"><inject bean="ServletContainerFactory"/></property>
+ <property name="next"><inject bean="ProducerCacheInterceptor"/></property>
+ </bean>
+ <bean name="ProducerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor">
+ <property name="next"><inject bean="CCPPInterceptor"/></property>
+ </bean>
+ <bean name="CCPPInterceptor" class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor">
+ <property name="next"><inject bean="RequestAttributeConversationInterceptor"/></property>
+ </bean>
+ <bean name="RequestAttributeConversationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor">
+ <property name="next"><inject bean="EventPayloadInterceptor"/></property>
+ </bean>
+ <bean name="EventPayloadInterceptor" class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor">
+ <property name="next"><inject bean="PortletContainerDispatcher"/></property>
+ </bean>
+ <bean name="PortletContainerDispatcher" class="org.jboss.portal.portlet.container.ContainerPortletDispatcher">
+ </bean>
+
</deployment>
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/CCPPInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/CCPPInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/CCPPInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,9 +22,10 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.PortletInvokerException;
import javax.ccpp.Profile;
import javax.ccpp.Attribute;
@@ -43,9 +44,10 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class CCPPInterceptor extends PortletInterceptor
+public class CCPPInterceptor extends PortletInvokerInterceptor
{
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
Map<String, Object> requestAttributes = invocation.getRequestAttributes();
@@ -60,7 +62,7 @@
requestAttributes.put("javax.portlet.ccpp", SIMPLE_PROFILE);
//
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
/**
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
import org.jboss.portal.portlet.invocation.response.cache.ContentRef;
import org.jboss.portal.portlet.invocation.response.cache.StrongContentRef;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -32,9 +32,9 @@
import org.jboss.portal.portlet.invocation.response.ContentResponse;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.cache.CacheControl;
-import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.WindowState;
import org.jboss.portal.Mode;
@@ -48,10 +48,10 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ConsumerCacheInterceptor extends PortletInterceptor
+public class ConsumerCacheInterceptor extends PortletInvokerInterceptor
{
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
// Compute the cache key
String scopeKey = "cached_markup." + invocation.getWindowContext().getId();
@@ -159,7 +159,7 @@
}
// Invoke
- PortletInvocationResponse response = (PortletInvocationResponse)invocation.invokeNext();
+ PortletInvocationResponse response = super.invoke(invocation);
// Try to cache any fragment result
CacheControl control = null;
@@ -226,7 +226,7 @@
userContext.setAttribute(scopeKey, null);
// Invoke
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,16 +22,17 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.ContainerPortletInvoker;
import org.jboss.portal.web.RequestDispatchCallback;
import org.jboss.portal.web.ServletContainer;
import org.jboss.portal.web.ServletContainerFactory;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.ServerContext;
+import org.jboss.portal.portlet.PortletInvokerException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -45,7 +46,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7226 $
*/
-public class ContextDispatcherInterceptor extends PortletInterceptor
+public class ContextDispatcherInterceptor extends PortletInvokerInterceptor
{
/** . */
@@ -64,7 +65,7 @@
this.servletContainerFactory = servletContainerFactory;
}
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
PortletApplication portletApplication = container.getPortletApplication();
@@ -73,19 +74,35 @@
ServletContainer servletContainer = servletContainerFactory.getServletContainer();
try
{
- return reqCtx.dispatch(servletContainer, targetCtx, callback, invocation);
+ return (PortletInvocationResponse)reqCtx.dispatch(servletContainer, targetCtx, callback, invocation);
}
- catch (ServletException e)
+ catch (Exception e)
{
- if (e.getRootCause() != null && e.getRootCause() instanceof Exception)
+ if (e instanceof PortletInvokerException)
{
- throw (Exception)e.getRootCause();
+ throw (PortletInvokerException)e;
}
- throw e;
+ else if (e instanceof RuntimeException)
+ {
+ throw (RuntimeException)e;
+ }
+ else if (e instanceof ServletException)
+ {
+ ServletException se = (ServletException)e;
+
+ //
+ if (se.getRootCause() != null && se.getRootCause() instanceof Exception)
+ {
+ e = (Exception)se.getRootCause();
+ }
+ }
+
+ //
+ throw new PortletInvokerException(e);
}
}
- private static final RequestDispatchCallback callback = new RequestDispatchCallback()
+ private final RequestDispatchCallback callback = new RequestDispatchCallback()
{
public Object doCallback(ServletContext dispatchedServletContext, HttpServletRequest req, HttpServletResponse resp, Object handback) throws ServletException, IOException
{
@@ -98,10 +115,12 @@
// Set dispatched request and response and invocation
invocation.setDispatchedRequest(req);
invocation.setDispatchedResponse(resp);
- invocation.getDispatchedRequest().setAttribute(REQ_ATT_COMPONENT_INVOCATION, invocation);
//
- return invocation.invokeNext();
+ req.setAttribute(REQ_ATT_COMPONENT_INVOCATION, invocation);
+
+ //
+ return ContextDispatcherInterceptor.super.invoke(invocation);
}
catch (Exception e)
{
@@ -110,7 +129,9 @@
finally
{
// Clear dispatched request and response
- invocation.getDispatchedRequest().setAttribute(REQ_ATT_COMPONENT_INVOCATION, null);
+ req.setAttribute(REQ_ATT_COMPONENT_INVOCATION, null);
+
+ //
invocation.setDispatchedRequest(null);
invocation.setDispatchedResponse(null);
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/EventPayloadInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/EventPayloadInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/EventPayloadInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,10 +22,11 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.ContainerPortletInvoker;
import org.jboss.portal.portlet.container.PortletApplication;
@@ -34,7 +35,7 @@
import org.jboss.portal.portlet.info.EventingInfo;
import org.jboss.portal.portlet.info.EventInfo;
import org.jboss.portal.portlet.impl.info.ContainerTypeInfo;
-import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.common.io.IOTools;
import org.apache.log4j.Logger;
@@ -50,13 +51,13 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class EventPayloadInterceptor extends PortletInterceptor
+public class EventPayloadInterceptor extends PortletInvokerInterceptor
{
/** . */
private final static Logger log = Logger.getLogger(EventPayloadInterceptor.class);
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
if (invocation instanceof EventInvocation)
{
@@ -183,7 +184,7 @@
//
try
{
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
finally
{
@@ -192,7 +193,7 @@
}
else
{
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,9 +22,10 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.PortletInvokerException;
/**
* An interceptor whose purpose is to detect invocation from the local portal.
@@ -32,7 +33,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class LocalInterceptor extends PortletInterceptor
+public class LocalInterceptor extends PortletInvokerInterceptor
{
/** . */
@@ -43,12 +44,12 @@
return Boolean.TRUE.equals(local.get());
}
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
try
{
local.set(Boolean.TRUE);
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
finally
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/PortletCustomizationInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/PortletCustomizationInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/PortletCustomizationInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,16 +22,17 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.state.AccessMode;
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.PortletInvokerException;
/**
* <p>This interceptor takes in charge the management of portlet customization when the invocation carries
@@ -43,9 +44,9 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class PortletCustomizationInterceptor extends PortletInterceptor
+public class PortletCustomizationInterceptor extends PortletInvokerInterceptor
{
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
InstanceContext oldContext = invocation.getInstanceContext();
if ((invocation instanceof ActionInvocation || invocation instanceof EventInvocation) && oldContext.getAccessMode() == AccessMode.READ_ONLY)
@@ -61,7 +62,7 @@
invocation.setTarget(newContext.getTarget());
//
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
finally
{
@@ -71,7 +72,7 @@
}
else
{
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,10 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.apache.log4j.Logger;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
/**
* Not removed as it is a place holder to implement producer cache (i.e caching markup
@@ -34,14 +31,6 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7226 $
*/
-public class ProducerCacheInterceptor extends PortletInterceptor
+public class ProducerCacheInterceptor extends PortletInvokerInterceptor
{
-
- /** . */
- private final Logger log = Logger.getLogger(ProducerCacheInterceptor.class);
-
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
- {
- return invocation.invokeNext();
- }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/RequestAttributeConversationInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/RequestAttributeConversationInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/RequestAttributeConversationInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,19 +22,20 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.ContainerPortletInvoker;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
import org.jboss.portal.portlet.impl.info.ContainerOptionInfo;
import org.jboss.portal.portlet.ParametersStateString;
-import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.common.util.UUIDGenerator;
import javax.servlet.http.HttpServletRequest;
@@ -53,13 +54,13 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class RequestAttributeConversationInterceptor extends PortletInterceptor
+public class RequestAttributeConversationInterceptor extends PortletInvokerInterceptor
{
/** . */
private static final UUIDGenerator generator = new UUIDGenerator();
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
ContainerPortletInfo containerInfo = (ContainerPortletInfo)container.getInfo();
@@ -110,21 +111,21 @@
}
else
{
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
}
else
{
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
}
- private Object invoke(int maxScope, ActionInvocation actionInvocation) throws Exception, InvocationException
+ private PortletInvocationResponse invoke(int maxScope, ActionInvocation actionInvocation) throws IllegalArgumentException, PortletInvokerException
{
return invokeWithConversation(maxScope, new Conversation(), actionInvocation);
}
- private Object invoke(int maxScope, EventInvocation eventInvocation) throws Exception, InvocationException
+ private PortletInvocationResponse invoke(int maxScope, EventInvocation eventInvocation) throws IllegalArgumentException, PortletInvokerException
{
Conversation conversation = loadConversation(eventInvocation);
@@ -138,7 +139,7 @@
return invokeWithConversation(maxScope, conversation, eventInvocation);
}
- private Object invoke(RenderInvocation renderInvocation) throws Exception, InvocationException
+ private PortletInvocationResponse invoke(RenderInvocation renderInvocation) throws IllegalArgumentException, PortletInvokerException
{
Conversation conversation = loadConversation(renderInvocation);
@@ -152,11 +153,11 @@
}
else
{
- return renderInvocation.invokeNext();
+ return super.invoke(renderInvocation);
}
}
- private Object invoke(ResourceInvocation resourceInvocation) throws Exception, InvocationException
+ private PortletInvocationResponse invoke(ResourceInvocation resourceInvocation) throws IllegalArgumentException, PortletInvokerException
{
Conversation conversation = loadConversation(resourceInvocation);
@@ -167,7 +168,7 @@
}
else
{
- return resourceInvocation.invokeNext();
+ return super.invoke(resourceInvocation);
}
}
@@ -203,10 +204,10 @@
return null;
}
- private Object invokeWithConversation(
+ private PortletInvocationResponse invokeWithConversation(
int maxScope,
Conversation conversation,
- PortletInvocation invocation) throws Exception, InvocationException
+ PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
invocation.setRequestAttributes(conversation.getAttributes());
@@ -220,7 +221,7 @@
inNS.setValue("javax.portlet.as", conversation.id);
//
- Object response = invocation.invokeNext();
+ PortletInvocationResponse response = super.invoke(invocation);
//
if (response instanceof UpdateNavigationalStateResponse)
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,15 +22,16 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.container.ContainerPortletInvoker;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
import org.jboss.portal.portlet.invocation.response.InsufficientTransportGuaranteeResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.SecurityContext;
/**
@@ -39,10 +40,10 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7226 $
*/
-public class SecureTransportInterceptor extends PortletInterceptor
+public class SecureTransportInterceptor extends PortletInvokerInterceptor
{
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
PortletInfo containerInfo = container.getInfo();
@@ -65,7 +66,7 @@
if (invoke)
{
// Invoke
- return invocation.invokeNext();
+ return super.invoke(invocation);
}
else
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,16 +22,16 @@
******************************************************************************/
package org.jboss.portal.portlet.aspects.portlet;
-import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.concurrent.Valve;
import org.jboss.portal.portlet.container.ContainerPortletInvoker;
import org.jboss.portal.portlet.container.PortletContainerContext;
import org.jboss.portal.portlet.container.managed.PortletApplicationRegistry;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
+import org.jboss.portal.portlet.PortletInvokerException;
/**
* This aspect has two responsabilities :<br/> <ul> <li>continue the request only if the portlet container valve is
@@ -43,7 +43,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7226 $
*/
-public class ValveInterceptor extends PortletInterceptor
+public class ValveInterceptor extends PortletInvokerInterceptor
{
/** . */
@@ -59,7 +59,7 @@
this.registry = portletApplicationRegistry;
}
- protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
PortletContainerImpl container = (PortletContainerImpl)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
@@ -72,7 +72,7 @@
try
{
- response = (PortletInvocationResponse)invocation.invokeNext();
+ response = super.invoke(invocation);
}
finally
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/ContainerPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/ContainerPortletInvoker.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/ContainerPortletInvoker.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -23,19 +23,17 @@
package org.jboss.portal.portlet.container;
import org.jboss.portal.common.invocation.InterceptorStackFactory;
-import org.jboss.portal.common.invocation.Invocation;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.invocation.InvocationHandler;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.impl.info.ContainerPreferencesInfo;
import org.jboss.portal.portlet.impl.info.ContainerPortletInfo;
import org.jboss.portal.portlet.impl.info.ContainerPreferenceInfo;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
@@ -54,51 +52,15 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7226 $
*/
-public class ContainerPortletInvoker implements PortletInvoker
+public class ContainerPortletInvoker extends PortletInvokerInterceptor
{
/** The key under which the portlet container is stored in the request scope of the invocation. */
public static final String PORTLET_CONTAINER = "PORTLET_CONTAINER";
/** . */
- private InterceptorStackFactory stackFactory;
-
- /** . */
private Map<String, Portlet> portlets = new HashMap<String, Portlet>();
- /** . */
- private InvocationHandler handler = new InvocationHandler()
- {
- public Object invoke(Invocation invocation) throws Exception, org.jboss.portal.common.invocation.InvocationException
- {
- PortletInvocation portletInvocation = (PortletInvocation)invocation;
-
- //
- try
- {
- portletInvocation.setHandler(null);
-
- //
- PortletContainer container = (PortletContainer)portletInvocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
- return container.dispatch(portletInvocation);
- }
- finally
- {
- portletInvocation.setHandler(this);
- }
- }
- };
-
- public InterceptorStackFactory getStackFactory()
- {
- return stackFactory;
- }
-
- public void setStackFactory(InterceptorStackFactory stackFactory)
- {
- this.stackFactory = stackFactory;
- }
-
public void addPortletContainer(PortletContainer portletContainer)
{
Map<String, Portlet> portlets = new HashMap<String, Portlet>(this.portlets);
@@ -119,14 +81,6 @@
this.portlets = portlets;
}
- public void start() throws Exception
- {
- }
-
- public void stop() throws Exception
- {
- }
-
public Set<Portlet> getPortlets()
{
return new HashSet<Portlet>(portlets.values());
@@ -155,13 +109,12 @@
PortletContainer container = portlet.container;
//
- InvocationHandler prevHandler = invocation.getHandler();
try
{
-
- invocation.setHandler(handler);
invocation.setAttribute(ContainerPortletInvoker.PORTLET_CONTAINER, container);
- return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
+
+ //
+ return super.invoke(invocation);
}
catch (Exception e)
{
@@ -180,7 +133,6 @@
}
finally
{
- invocation.setHandler(prevHandler);
invocation.removeAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,21 +22,10 @@
******************************************************************************/
package org.jboss.portal.portlet.invocation;
-import org.jboss.portal.common.invocation.Invocation;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.invocation.Interceptor;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6712 $
*/
-public abstract class PortletInterceptor implements Interceptor
+public abstract class PortletInterceptor
{
-
- public Object invoke(Invocation invocation) throws Exception, InvocationException
- {
- return invoke((PortletInvocation)invocation);
- }
-
- protected abstract Object invoke(PortletInvocation invocation) throws Exception, InvocationException;
}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -1,137 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.invocation;
-
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.state.DestroyCloneFailure;
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.portlet.state.PropertyChange;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-
-import java.util.Set;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletInterceptor2 implements PortletInvoker
-{
-
- /** . */
- private PortletInvoker next;
-
- public PortletInterceptor2()
- {
- }
-
- public PortletInterceptor2(PortletInvoker next)
- {
- this.next = next;
- }
-
- public PortletInvoker getNext()
- {
- return next;
- }
-
- public void setNext(PortletInvoker next)
- {
- this.next = next;
- }
-
- public Set<Portlet> getPortlets() throws PortletInvokerException
- {
- if (next == null)
- {
- throw new IllegalStateException("No next invoker");
- }
- return next.getPortlets();
- }
-
- public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
- {
- if (next == null)
- {
- throw new IllegalStateException("No next invoker");
- }
- return next.getPortlet(portletContext);
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
- {
- if (next == null)
- {
- throw new IllegalStateException("No next invoker");
- }
- return next.invoke(invocation);
- }
-
- public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- if (next == null)
- {
- throw new IllegalStateException("No next invoker");
- }
- return next.createClone(portletContext);
- }
-
- public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- if (next == null)
- {
- throw new IllegalStateException("No next invoker");
- }
- return next.destroyClones(portletContexts);
- }
-
- public PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- if (next == null)
- {
- throw new IllegalStateException("No next invoker");
- }
- return next.getProperties(portletContext, keys);
- }
-
- public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- if (next == null)
- {
- throw new IllegalStateException("No next invoker");
- }
- return next.getProperties(portletContext);
- }
-
- public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- if (next == null)
- {
- throw new IllegalStateException("No next invoker");
- }
- return next.setProperties(portletContext, changes);
- }
-}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.invocation;
-import org.jboss.portal.common.invocation.Invocation;
import org.jboss.portal.common.invocation.AttributeResolver;
import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import org.jboss.portal.portlet.spi.InstanceContext;
@@ -47,7 +46,7 @@
* @version $Revision: 6765 $
* @since 2.4
*/
-public abstract class PortletInvocation extends Invocation
+public abstract class PortletInvocation
{
/** . */
Copied: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvokerInterceptor.java (from rev 10591, modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java)
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvokerInterceptor.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvokerInterceptor.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -0,0 +1,137 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.invocation;
+
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+
+import java.util.Set;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletInvokerInterceptor implements PortletInvoker
+{
+
+ /** . */
+ private PortletInvoker next;
+
+ public PortletInvokerInterceptor()
+ {
+ }
+
+ public PortletInvokerInterceptor(PortletInvoker next)
+ {
+ this.next = next;
+ }
+
+ public PortletInvoker getNext()
+ {
+ return next;
+ }
+
+ public void setNext(PortletInvoker next)
+ {
+ this.next = next;
+ }
+
+ public Set<Portlet> getPortlets() throws PortletInvokerException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.getPortlets();
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.getPortlet(portletContext);
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.invoke(invocation);
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.createClone(portletContext);
+ }
+
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.destroyClones(portletContexts);
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.getProperties(portletContext, keys);
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.getProperties(portletContext);
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.setProperties(portletContext, changes);
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -30,7 +30,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.PortletInterceptor2;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AccessMode;
@@ -48,7 +48,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6765 $
*/
-public class ConsumerPortletInvoker extends PortletInterceptor2
+public class ConsumerPortletInvoker extends PortletInvokerInterceptor
{
/** . */
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -36,7 +36,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.PortletInterceptor2;
+import org.jboss.portal.portlet.invocation.PortletInvokerInterceptor;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AbstractPropertyContext;
@@ -63,7 +63,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6765 $
*/
-public class ProducerPortletInvoker extends PortletInterceptor2
+public class ProducerPortletInvoker extends PortletInvokerInterceptor
{
/** . */
Deleted: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/TestPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/TestPortletInvoker.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/TestPortletInvoker.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -1,158 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.state;
-
-import org.jboss.portal.common.invocation.InterceptorStackFactory;
-import org.jboss.portal.common.invocation.Invocation;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.invocation.InvocationHandler;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-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.DestroyCloneFailure;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * A simple consumer.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6712 $
- */
-public class TestPortletInvoker implements PortletInvoker
-{
-
- /** . */
- private InterceptorStackFactory stackFactory;
-
- /** . */
- private PortletInvoker producer;
-
- /** . */
- private InvocationHandler handler = new InvocationHandler()
- {
- public Object invoke(Invocation invocation) throws Exception, InvocationException
- {
- PortletInvocation portletInvocation = (PortletInvocation)invocation;
- try
- {
- portletInvocation.setHandler(null);
- return producer.invoke(portletInvocation);
- }
- finally
- {
- portletInvocation.setHandler(this);
- }
- }
- };
-
- public InterceptorStackFactory getStackFactory()
- {
- return stackFactory;
- }
-
- public void setStackFactory(InterceptorStackFactory stackFactory)
- {
- this.stackFactory = stackFactory;
- }
-
- public PortletInvoker getProducer()
- {
- return producer;
- }
-
- public void setProducer(PortletInvoker producer)
- {
- this.producer = producer;
- }
-
- public Set<Portlet> getPortlets() throws PortletInvokerException
- {
- return producer.getPortlets();
- }
-
- public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
- {
- return producer.getPortlet(portletContext);
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
- {
- InvocationHandler prevHandler = invocation.getHandler();
- try
- {
- invocation.setHandler(handler);
- return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
- }
- catch (Exception e)
- {
- if (e instanceof PortletInvokerException)
- {
- throw(PortletInvokerException)e;
- }
- else if (e instanceof RuntimeException)
- {
- throw(RuntimeException)e;
- }
- else
- {
- throw new PortletInvokerException(e);
- }
- }
- finally
- {
- invocation.setHandler(prevHandler);
- }
- }
-
- public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/TestPortletInvoker.java 2008-04-15 23:34:57 UTC (rev 10594)
@@ -1,159 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.common.invocation.InterceptorStackFactory;
-import org.jboss.portal.common.invocation.Invocation;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.invocation.InvocationHandler;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-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.portlet.state.PropertyChange;
-import org.jboss.portal.portlet.state.PropertyMap;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * A simple consumer.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6712 $
- */
-public class TestPortletInvoker implements PortletInvoker
-{
-
- /** . */
- private InterceptorStackFactory stackFactory;
-
- /** . */
- private PortletInvoker producer;
-
- /** . */
- private InvocationHandler handler = new InvocationHandler()
- {
- public Object invoke(Invocation invocation) throws Exception, InvocationException
- {
- PortletInvocation portletInvocation = (PortletInvocation)invocation;
- try
- {
- portletInvocation.setHandler(null);
- return producer.invoke(portletInvocation);
- }
- finally
- {
- portletInvocation.setHandler(this);
- }
- }
- };
-
- public InterceptorStackFactory getStackFactory()
- {
- return stackFactory;
- }
-
- public void setStackFactory(InterceptorStackFactory stackFactory)
- {
- this.stackFactory = stackFactory;
- }
-
- public PortletInvoker getProducer()
- {
- return producer;
- }
-
- public void setProducer(PortletInvoker producer)
- {
- this.producer = producer;
- }
-
- public Set<Portlet> getPortlets() throws PortletInvokerException
- {
- return producer.getPortlets();
- }
-
- public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
- {
- return producer.getPortlet(portletContext);
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
- {
- InvocationHandler prevHandler = invocation.getHandler();
- try
- {
- invocation.setHandler(handler);
- return (PortletInvocationResponse)invocation.invoke(stackFactory.getInterceptorStack());
- }
- catch (Exception e)
- {
- if (e instanceof PortletInvokerException)
- {
- throw (PortletInvokerException)e;
- }
- else if (e instanceof RuntimeException)
- {
- throw (RuntimeException)e;
- }
- else
- {
- throw new PortletInvokerException(e);
- }
- }
- finally
- {
- invocation.setHandler(prevHandler);
- }
- }
-
- public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-}
Modified: modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml 2008-04-15 23:34:57 UTC (rev 10594)
@@ -53,76 +53,66 @@
</constructor>
</bean>
- <!-- Consumer stack -->
+ <!-- The producer persistence manager -->
+ <bean name="ProducerPersistenceManager" class="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
+
+ <!-- The producer state management policy -->
+ <bean name="ProducerStateManagementPolicy" class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
+ <property name="persistLocally"><value>true</value></property>
+ </bean>
+
+ <!-- The producer state converter -->
+ <bean name="ProducerStateConverter" class="org.jboss.portal.portlet.impl.state.StateConverterV0"/>
+
+ <!-- The consumer portlet invoker -->
+ <bean name="ConsumerPortletInvoker" class="org.jboss.portal.portlet.invocation.PortletInvokerInterceptor">
+ <property name="next"><inject bean="ConsumerCacheInterceptor"/></property>
+ </bean>
<bean name="ConsumerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor">
+ <property name="next"><inject bean="PortletCustomizationInterceptor"/></property>
</bean>
<bean name="PortletCustomizationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.PortletCustomizationInterceptor">
+ <property name="next"><inject bean="ProducerPortletInvoker"/></property>
</bean>
- <bean name="ConsumerStackFactory" class="org.jboss.portal.portlet.test.InterceptorStackFactoryImpl">
- <property name="interceptors">
- <array>
- <inject bean="ConsumerCacheInterceptor"/>
- <inject bean="PortletCustomizationInterceptor"/>
- </array>
- </property>
+
+ <!-- The producer portlet invoker -->
+ <bean name="ProducerPortletInvoker" class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
+ <property name="next"><inject bean="ContainerPortletInvoker"/></property>
+ <property name="persistenceManager"><inject bean="ProducerPersistenceManager"/></property>
+ <property name="stateManagementPolicy"><inject bean="ProducerStateManagementPolicy"/></property>
+ <property name="stateConverter"><inject bean="ProducerStateConverter"/></property>
</bean>
- <!-- The consumer portlet invoker -->
- <bean name="ConsumerPortletInvoker" class="org.jboss.portal.portlet.test.controller.TestPortletInvoker">
- <property name="producer"><inject bean="ProducerPortletInvoker"/></property>
- <property name="stackFactory"><inject bean="ConsumerStackFactory"/></property>
+ <!-- The portlet container invoker -->
+ <bean name="ContainerPortletInvoker" class="org.jboss.portal.portlet.container.ContainerPortletInvoker">
+ <property name="next"><inject bean="ValveInterceptor"/></property>
</bean>
<!-- Container stack -->
<bean name="ValveInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor">
<property name="portletApplicationRegistry"><inject bean="PortletApplicationRegistry" state="Instantiated"/></property>
+ <property name="next"><inject bean="SecureTransportInterceptor"/></property>
</bean>
- <bean name="SecureTransportInterceptor" class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor"/>
- <bean name="ContextDispatcherInterceptor"
- class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
+ <bean name="SecureTransportInterceptor" class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor">
+ <property name="next"><inject bean="ContextDispatcherInterceptor"/></property>
+ </bean>
+ <bean name="ContextDispatcherInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
<property name="servletContainerFactory"><inject bean="ServletContainerFactory"/></property>
+ <property name="next"><inject bean="ProducerCacheInterceptor"/></property>
</bean>
- <bean name="ProducerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"/>
- <bean name="CCPPInterceptor" class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor"/>
- <bean name="RequestAttributeConversationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor"/>
- <bean name="EventPayloadInterceptor" class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor"/>
- <bean name="ContainerStackFactory" class="org.jboss.portal.portlet.test.InterceptorStackFactoryImpl">
- <property name="interceptors">
- <array>
- <inject bean="ValveInterceptor"/>
- <inject bean="SecureTransportInterceptor"/>
- <inject bean="ContextDispatcherInterceptor"/>
- <inject bean="ProducerCacheInterceptor"/>
- <inject bean="CCPPInterceptor"/>
- <inject bean="RequestAttributeConversationInterceptor"/>
- <inject bean="EventPayloadInterceptor"/>
- </array>
- </property>
+ <bean name="ProducerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor">
+ <property name="next"><inject bean="CCPPInterceptor"/></property>
</bean>
-
- <!-- The portlet container invoker -->
- <bean name="ContainerPortletInvoker" class="org.jboss.portal.portlet.container.ContainerPortletInvoker">
- <property name="stackFactory"><inject bean="ContainerStackFactory"/></property>
+ <bean name="CCPPInterceptor" class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor">
+ <property name="next"><inject bean="RequestAttributeConversationInterceptor"/></property>
</bean>
-
- <!-- The producer persistence manager -->
- <bean name="ProducerPersistenceManager"
- class="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
-
- <!-- The producer state management policy -->
- <bean name="ProducerStateManagementPolicy" class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
- <property name="persistLocally"><value>true</value></property>
+ <bean name="RequestAttributeConversationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor">
+ <property name="next"><inject bean="EventPayloadInterceptor"/></property>
</bean>
-
- <!-- The producer state converter -->
- <bean name="ProducerStateConverter" class="org.jboss.portal.portlet.impl.state.StateConverterV0"/>
-
- <!-- The producer portlet invoker -->
- <bean name="ProducerPortletInvoker" class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
- <property name="next"><inject bean="ContainerPortletInvoker"/></property>
- <property name="persistenceManager"><inject bean="ProducerPersistenceManager"/></property>
- <property name="stateManagementPolicy"><inject bean="ProducerStateManagementPolicy"/></property>
- <property name="stateConverter"><inject bean="ProducerStateConverter"/></property>
+ <bean name="EventPayloadInterceptor" class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor">
+ <property name="next"><inject bean="PortletContainerDispatcher"/></property>
</bean>
+ <bean name="PortletContainerDispatcher" class="org.jboss.portal.portlet.container.ContainerPortletDispatcher">
+ </bean>
</deployment>
Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-04-15 20:03:41 UTC (rev 10593)
+++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-04-15 23:34:57 UTC (rev 10594)
@@ -53,76 +53,66 @@
</constructor>
</bean>
- <!-- Consumer stack -->
+ <!-- The producer persistence manager -->
+ <bean name="ProducerPersistenceManager" class="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
+
+ <!-- The producer state management policy -->
+ <bean name="ProducerStateManagementPolicy" class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
+ <property name="persistLocally"><value>true</value></property>
+ </bean>
+
+ <!-- The producer state converter -->
+ <bean name="ProducerStateConverter" class="org.jboss.portal.portlet.impl.state.StateConverterV0"/>
+
+ <!-- The consumer portlet invoker -->
+ <bean name="ConsumerPortletInvoker" class="org.jboss.portal.portlet.invocation.PortletInvokerInterceptor">
+ <property name="next"><inject bean="ConsumerCacheInterceptor"/></property>
+ </bean>
<bean name="ConsumerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor">
+ <property name="next"><inject bean="PortletCustomizationInterceptor"/></property>
</bean>
<bean name="PortletCustomizationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.PortletCustomizationInterceptor">
+ <property name="next"><inject bean="ProducerPortletInvoker"/></property>
</bean>
- <bean name="ConsumerStackFactory" class="org.jboss.portal.portlet.test.InterceptorStackFactoryImpl">
- <property name="interceptors">
- <array>
- <inject bean="ConsumerCacheInterceptor"/>
- <inject bean="PortletCustomizationInterceptor"/>
- </array>
- </property>
+
+ <!-- The producer portlet invoker -->
+ <bean name="ProducerPortletInvoker" class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
+ <property name="next"><inject bean="ContainerPortletInvoker"/></property>
+ <property name="persistenceManager"><inject bean="ProducerPersistenceManager"/></property>
+ <property name="stateManagementPolicy"><inject bean="ProducerStateManagementPolicy"/></property>
+ <property name="stateConverter"><inject bean="ProducerStateConverter"/></property>
</bean>
- <!-- The consumer portlet invoker -->
- <bean name="ConsumerPortletInvoker" class="org.jboss.portal.portlet.test.controller.TestPortletInvoker">
- <property name="producer"><inject bean="ProducerPortletInvoker"/></property>
- <property name="stackFactory"><inject bean="ConsumerStackFactory"/></property>
+ <!-- The portlet container invoker -->
+ <bean name="ContainerPortletInvoker" class="org.jboss.portal.portlet.container.ContainerPortletInvoker">
+ <property name="next"><inject bean="ValveInterceptor"/></property>
</bean>
<!-- Container stack -->
<bean name="ValveInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor">
<property name="portletApplicationRegistry"><inject bean="PortletApplicationRegistry" state="Instantiated"/></property>
+ <property name="next"><inject bean="SecureTransportInterceptor"/></property>
</bean>
- <bean name="SecureTransportInterceptor" class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor"/>
- <bean name="ContextDispatcherInterceptor"
- class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
+ <bean name="SecureTransportInterceptor" class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor">
+ <property name="next"><inject bean="ContextDispatcherInterceptor"/></property>
+ </bean>
+ <bean name="ContextDispatcherInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
<property name="servletContainerFactory"><inject bean="ServletContainerFactory"/></property>
+ <property name="next"><inject bean="ProducerCacheInterceptor"/></property>
</bean>
- <bean name="ProducerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"/>
- <bean name="CCPPInterceptor" class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor"/>
- <bean name="RequestAttributeConversationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor"/>
- <bean name="EventPayloadInterceptor" class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor"/>
- <bean name="ContainerStackFactory" class="org.jboss.portal.portlet.test.InterceptorStackFactoryImpl">
- <property name="interceptors">
- <array>
- <inject bean="ValveInterceptor"/>
- <inject bean="SecureTransportInterceptor"/>
- <inject bean="ContextDispatcherInterceptor"/>
- <inject bean="ProducerCacheInterceptor"/>
- <inject bean="CCPPInterceptor"/>
- <inject bean="RequestAttributeConversationInterceptor"/>
- <inject bean="EventPayloadInterceptor"/>
- </array>
- </property>
+ <bean name="ProducerCacheInterceptor" class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor">
+ <property name="next"><inject bean="CCPPInterceptor"/></property>
</bean>
-
- <!-- The portlet container invoker -->
- <bean name="ContainerPortletInvoker" class="org.jboss.portal.portlet.container.ContainerPortletInvoker">
- <property name="stackFactory"><inject bean="ContainerStackFactory"/></property>
+ <bean name="CCPPInterceptor" class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor">
+ <property name="next"><inject bean="RequestAttributeConversationInterceptor"/></property>
</bean>
-
- <!-- The producer persistence manager -->
- <bean name="ProducerPersistenceManager"
- class="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
-
- <!-- The producer state management policy -->
- <bean name="ProducerStateManagementPolicy" class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
- <property name="persistLocally"><value>true</value></property>
+ <bean name="RequestAttributeConversationInterceptor" class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor">
+ <property name="next"><inject bean="EventPayloadInterceptor"/></property>
</bean>
-
- <!-- The producer state converter -->
- <bean name="ProducerStateConverter" class="org.jboss.portal.portlet.impl.state.StateConverterV0"/>
-
- <!-- The producer portlet invoker -->
- <bean name="ProducerPortletInvoker" class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
- <property name="next"><inject bean="ContainerPortletInvoker"/></property>
- <property name="persistenceManager"><inject bean="ProducerPersistenceManager"/></property>
- <property name="stateManagementPolicy"><inject bean="ProducerStateManagementPolicy"/></property>
- <property name="stateConverter"><inject bean="ProducerStateConverter"/></property>
+ <bean name="EventPayloadInterceptor" class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor">
+ <property name="next"><inject bean="PortletContainerDispatcher"/></property>
</bean>
+ <bean name="PortletContainerDispatcher" class="org.jboss.portal.portlet.container.ContainerPortletDispatcher">
+ </bean>
</deployment>
18 years
JBoss Portal SVN: r10593 - modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-04-15 16:03:41 -0400 (Tue, 15 Apr 2008)
New Revision: 10593
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
Log:
fix - close LDAP context
Modified: modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
===================================================================
--- modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2008-04-15 20:03:15 UTC (rev 10592)
+++ modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2008-04-15 20:03:41 UTC (rev 10593)
@@ -75,7 +75,9 @@
SearchResult res = (SearchResult)sr.iterator().next();
Context ctx = (Context)res.getObject();
String dn = ctx.getNameInNamespace();
- return createUserInstance(res.getAttributes(), dn);
+ User user = createUserInstance(res.getAttributes(), dn);
+ ctx.close();
+ return user;
}
catch (NoSuchElementException e)
Modified: modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
===================================================================
--- modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2008-04-15 20:03:15 UTC (rev 10592)
+++ modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2008-04-15 20:03:41 UTC (rev 10593)
@@ -87,7 +87,9 @@
SearchResult res = (SearchResult)sr.iterator().next();
Context ctx = (Context)res.getObject();
String dn = ctx.getNameInNamespace();
- return createUserInstance(res.getAttributes(), dn);
+ User user = createUserInstance(res.getAttributes(), dn);
+ ctx.close();
+ return user;
}
catch (NoSuchElementException e)
18 years
JBoss Portal SVN: r10592 - modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-04-15 16:03:15 -0400 (Tue, 15 Apr 2008)
New Revision: 10592
Modified:
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
Log:
fix - close LDAP context
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2008-04-15 12:30:52 UTC (rev 10591)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtUserModuleImpl.java 2008-04-15 20:03:15 UTC (rev 10592)
@@ -75,7 +75,9 @@
SearchResult res = (SearchResult)sr.iterator().next();
Context ctx = (Context)res.getObject();
String dn = ctx.getNameInNamespace();
- return createUserInstance(res.getAttributes(), dn);
+ User user = createUserInstance(res.getAttributes(), dn);
+ ctx.close();
+ return user;
}
catch (NoSuchElementException e)
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2008-04-15 12:30:52 UTC (rev 10591)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPUserModuleImpl.java 2008-04-15 20:03:15 UTC (rev 10592)
@@ -87,7 +87,9 @@
SearchResult res = (SearchResult)sr.iterator().next();
Context ctx = (Context)res.getObject();
String dn = ctx.getNameInNamespace();
- return createUserInstance(res.getAttributes(), dn);
+ User user = createUserInstance(res.getAttributes(), dn);
+ ctx.close();
+ return user;
}
catch (NoSuchElementException e)
18 years
JBoss Portal SVN: r10591 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/invocation and 5 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-04-15 08:30:52 -0400 (Tue, 15 Apr 2008)
New Revision: 10591
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java
Modified:
modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml
modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
Log:
make the ProducerPortletInvoker and ConsumerPortletInvoker use a new PortletInterceptor that handles all methods and not only runtime methods
Modified: modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-04-15 12:14:03 UTC (rev 10590)
+++ modules/portlet/trunk/portal/src/main/resources/simple-portal-war/WEB-INF/jboss-beans.xml 2008-04-15 12:30:52 UTC (rev 10591)
@@ -104,7 +104,7 @@
<!-- The producer portlet invoker -->
<bean name="ProducerPortletInvoker" class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
- <property name="portletInvoker"><inject bean="ContainerPortletInvoker"/></property>
+ <property name="next"><inject bean="ContainerPortletInvoker"/></property>
<property name="persistenceManager"><inject bean="ProducerPersistenceManager"/></property>
<property name="stateManagementPolicy"><inject bean="ProducerStateManagementPolicy"/></property>
<property name="stateConverter"><inject bean="ProducerStateConverter"/></property>
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInterceptor2.java 2008-04-15 12:30:52 UTC (rev 10591)
@@ -0,0 +1,137 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.invocation;
+
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+
+import java.util.Set;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletInterceptor2 implements PortletInvoker
+{
+
+ /** . */
+ private PortletInvoker next;
+
+ public PortletInterceptor2()
+ {
+ }
+
+ public PortletInterceptor2(PortletInvoker next)
+ {
+ this.next = next;
+ }
+
+ public PortletInvoker getNext()
+ {
+ return next;
+ }
+
+ public void setNext(PortletInvoker next)
+ {
+ this.next = next;
+ }
+
+ public Set<Portlet> getPortlets() throws PortletInvokerException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.getPortlets();
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.getPortlet(portletContext);
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.invoke(invocation);
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.createClone(portletContext);
+ }
+
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.destroyClones(portletContexts);
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.getProperties(portletContext, keys);
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.getProperties(portletContext);
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ if (next == null)
+ {
+ throw new IllegalStateException("No next invoker");
+ }
+ return next.setProperties(portletContext, changes);
+ }
+}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2008-04-15 12:14:03 UTC (rev 10590)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2008-04-15 12:30:52 UTC (rev 10591)
@@ -27,10 +27,10 @@
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.PortletInterceptor2;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AccessMode;
@@ -48,16 +48,13 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6765 $
*/
-public class ConsumerPortletInvoker implements PortletInvoker
+public class ConsumerPortletInvoker extends PortletInterceptor2
{
/** . */
private static final String CLONE_ID_PREFIX = "@";
/** . */
- private PortletInvoker producer;
-
- /** . */
private ConsumerPersistenceManager persistenceManager;
public PortletContext unwrapCCP(String wrappedCCP) throws InvalidPortletIdException
@@ -104,26 +101,6 @@
return popCtx.getId();
}
- /**
- * Returns the producer.
- *
- * @return the producer
- */
- public PortletInvoker getProducer()
- {
- return producer;
- }
-
- /**
- * Sets the producer.
- *
- * @param producer the producer
- */
- public void setProducer(PortletInvoker producer)
- {
- this.producer = producer;
- }
-
public void setPersistenceManager(ConsumerPersistenceManager persistenceManager)
{
this.persistenceManager = persistenceManager;
@@ -133,7 +110,7 @@
public Set<Portlet> getPortlets() throws PortletInvokerException
{
// We don't need proxies here because we return the list of offered portlets
- return producer.getPortlets();
+ return super.getPortlets();
}
public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
@@ -162,7 +139,7 @@
invocation.setInstanceContext(pictx);
//
- PortletInvocationResponse response = producer.invoke(invocation);
+ PortletInvocationResponse response = super.invoke(invocation);
//
PortletContext clonedContext = pictx.clonedContext;
@@ -225,7 +202,7 @@
ConsumerContext consumerContext = getConsumerContext(portletContext);
//
- PortletContext clonedContext = producer.createClone(consumerContext.producerPortletContext);
+ PortletContext clonedContext = super.createClone(consumerContext.producerPortletContext);
byte[] state = clonedContext.getState();
if (state != null)
@@ -270,7 +247,7 @@
}
//
- List<DestroyCloneFailure> failures = producer.destroyClones(portletContexts);
+ List<DestroyCloneFailure> failures = super.destroyClones(portletContexts);
// Probably should wrap the portlet context here ????
// for (Iterator i = failures.iterator(); i.hasNext();)
@@ -286,13 +263,13 @@
public PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
ConsumerContext consumerContext = getConsumerContext(portletContext);
- return producer.getProperties(consumerContext.producerPortletContext, keys);
+ return super.getProperties(consumerContext.producerPortletContext, keys);
}
public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
ConsumerContext consumerContext = getConsumerContext(portletContext);
- return producer.getProperties(consumerContext.producerPortletContext);
+ return super.getProperties(consumerContext.producerPortletContext);
}
public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
@@ -300,7 +277,7 @@
ConsumerContext consumerContext = getConsumerContext(portletContext);
//
- PortletContext updatedPortletContext = producer.setProperties(consumerContext.producerPortletContext, changes);
+ PortletContext updatedPortletContext = super.setProperties(consumerContext.producerPortletContext, changes);
byte[] state = updatedPortletContext.getState();
if (state != null)
@@ -444,7 +421,7 @@
{
if (portlet == null)
{
- Portlet producerPortlet = producer.getPortlet(producerPortletContext);
+ Portlet producerPortlet = ConsumerPortletInvoker.super.getPortlet(producerPortletContext);
//
if (stateId == null)
@@ -460,6 +437,5 @@
//
return portlet;
}
-
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2008-04-15 12:14:03 UTC (rev 10590)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2008-04-15 12:30:52 UTC (rev 10591)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.StatefulPortletContext;
@@ -37,6 +36,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.PortletInterceptor2;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AbstractPropertyContext;
@@ -63,7 +63,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6765 $
*/
-public class ProducerPortletInvoker implements PortletInvoker
+public class ProducerPortletInvoker extends PortletInterceptor2
{
/** . */
@@ -73,9 +73,6 @@
private static final String CONSUMER_CLONE_ID = "_dumbvalue";
/** . */
- private PortletInvoker portletInvoker;
-
- /** . */
private PortletStatePersistenceManager persistenceManager;
/** . */
@@ -87,16 +84,6 @@
/** . */
private Logger log = Logger.getLogger(ProducerPortletInvoker.class);
- public PortletInvoker getPortletInvoker()
- {
- return portletInvoker;
- }
-
- public void setPortletInvoker(PortletInvoker portletInvoker)
- {
- this.portletInvoker = portletInvoker;
- }
-
public PortletStatePersistenceManager getPersistenceManager()
{
return persistenceManager;
@@ -127,11 +114,6 @@
this.stateConverter = stateConverter;
}
- public Set<Portlet> getPortlets() throws PortletInvokerException
- {
- return portletInvoker.getPortlets();
- }
-
public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
{
if (portletContext == null)
@@ -153,7 +135,7 @@
try
{
PortletState portletState = stateConverter.unmarshall(state);
- Portlet delegate = portletInvoker.getPortlet(PortletContext.createPortletContext(portletState.getPortletId()));
+ Portlet delegate = super.getPortlet(PortletContext.createPortletContext(portletState.getPortletId()));
return new ProducerPortlet(portletContext, delegate);
}
catch (StateConversionException e)
@@ -173,7 +155,7 @@
String stateId = portletId.substring(PRODUCER_CLONE_ID_PREFIX.length());
PortletStateContext stateContext = persistenceManager.loadState(stateId);
PortletState state = stateContext.getState();
- Portlet delegate = portletInvoker.getPortlet(PortletContext.createPortletContext(state.getPortletId()));
+ Portlet delegate = super.getPortlet(PortletContext.createPortletContext(state.getPortletId()));
return new ProducerPortlet(portletContext, delegate);
}
catch (NoSuchStateException e)
@@ -187,7 +169,7 @@
}
else
{
- return portletInvoker.getPortlet(portletContext);
+ return super.getPortlet(portletContext);
}
}
@@ -208,13 +190,13 @@
InternalContext context = getStateContext(portletContext);
// If it is a producer offered portlet we consider read-write as read-only
- if (context.isStateful() == false && access == AccessMode.READ_WRITE)
+ if (!context.isStateful() && access == AccessMode.READ_WRITE)
{
access = AccessMode.READ_ONLY;
}
// Get the portlet container and set it on invocation
- Portlet portlet = portletInvoker.getPortlet(context.getPortletContext());
+ Portlet portlet = super.getPortlet(context.getPortletContext());
if (portlet == null)
{
throw new NoSuchPortletException("Portlet " + context.getPortletContext() + " not found", context.getPortletId());
@@ -234,7 +216,7 @@
invocation.setAttribute(PropertyContext.PREFERENCES_ATTRIBUTE, prefs);
// Invoke
- response = portletInvoker.invoke(invocation);
+ response = super.invoke(invocation);
}
finally
{
@@ -493,7 +475,7 @@
PortletContext refPortletContext = context.getPortletContext();
// Get the referenced portlet
- Portlet refPortlet = portletInvoker.getPortlet(refPortletContext);
+ Portlet refPortlet = super.getPortlet(refPortletContext);
// We need the referenced portlet
if (refPortlet == null)
@@ -539,14 +521,14 @@
InternalContext context = getStateContext(portletContext);
//
- if (context.isStateful() == false)
+ if (!context.isStateful())
{
throw new InvalidPortletIdException("Cannot configure producer offered portlets", portletId);
}
StatefulContext statefulContext = (StatefulContext)context;
// Get the container
- Portlet referencedPortlet = portletInvoker.getPortlet(context.getPortletContext());
+ Portlet referencedPortlet = super.getPortlet(context.getPortletContext());
// We need the referenced portlet
if (referencedPortlet == null)
@@ -633,13 +615,13 @@
* Retrieve the properties from the portlet meta data.
*
* @param portletContext the portlet context
- * @return the properties
- * @throws PortletInvokerException
+ * @param props the properties
+ * @throws PortletInvokerException any portlet invoker exception
*/
private void getPropertiesFromMetaData(PortletContext portletContext, PropertyMap props) throws PortletInvokerException
{
//
- Portlet portlet = portletInvoker.getPortlet(portletContext);
+ Portlet portlet = super.getPortlet(portletContext);
// The prefs info
PreferencesInfo prefs = portlet.getInfo().getPreferences();
@@ -657,7 +639,7 @@
// Get the missing or read only properties from the referenced portlet properties
// and add them to the actual state
- PropertyMap refPreferencesInfo = portletInvoker.getProperties(portletContext, keys);
+ PropertyMap refPreferencesInfo = super.getProperties(portletContext, keys);
for (Map.Entry<String, List<String>> entry : refPreferencesInfo.entrySet())
{
String key = entry.getKey();
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2008-04-15 12:14:03 UTC (rev 10590)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ConsumerStatefulPortletInvokerTestCase.java 2008-04-15 12:30:52 UTC (rev 10591)
@@ -99,14 +99,14 @@
stateManagementPolicy.setPersistLocally(persistLocally);
//
- producer.setPortletInvoker(container);
+ producer.setNext(container);
producer.setPersistenceManager(portletStatePersistenceManager);
producer.setStateManagementPolicy(stateManagementPolicy);
producer.setStateConverter(stateConverter);
//
consumer.setPersistenceManager(consumerPersistenceManager);
- consumer.setProducer(producer);
+ consumer.setNext(producer);
}
protected PortletSupport getPortletSupport(PortletContext portletRef) throws PortletInvokerException
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2008-04-15 12:14:03 UTC (rev 10590)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ProducerStatefulPortletInvokerTestCase.java 2008-04-15 12:30:52 UTC (rev 10591)
@@ -88,7 +88,7 @@
stateManagementPolicy.setPersistLocally(persistLocally);
//
- producer.setPortletInvoker(container);
+ producer.setNext(container);
producer.setPersistenceManager(persistenceManager);
producer.setStateManagementPolicy(stateManagementPolicy);
producer.setStateConverter(stateConverter);
Modified: modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml 2008-04-15 12:14:03 UTC (rev 10590)
+++ modules/portlet/trunk/test/src/test/resources/portlet-tck-war/WEB-INF/jboss-beans.xml 2008-04-15 12:30:52 UTC (rev 10591)
@@ -119,7 +119,7 @@
<!-- The producer portlet invoker -->
<bean name="ProducerPortletInvoker" class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
- <property name="portletInvoker"><inject bean="ContainerPortletInvoker"/></property>
+ <property name="next"><inject bean="ContainerPortletInvoker"/></property>
<property name="persistenceManager"><inject bean="ProducerPersistenceManager"/></property>
<property name="stateManagementPolicy"><inject bean="ProducerStateManagementPolicy"/></property>
<property name="stateConverter"><inject bean="ProducerStateConverter"/></property>
Modified: modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-04-15 12:14:03 UTC (rev 10590)
+++ modules/portlet/trunk/test/src/test/resources/portlet-test-war/WEB-INF/jboss-beans.xml 2008-04-15 12:30:52 UTC (rev 10591)
@@ -119,7 +119,7 @@
<!-- The producer portlet invoker -->
<bean name="ProducerPortletInvoker" class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
- <property name="portletInvoker"><inject bean="ContainerPortletInvoker"/></property>
+ <property name="next"><inject bean="ContainerPortletInvoker"/></property>
<property name="persistenceManager"><inject bean="ProducerPersistenceManager"/></property>
<property name="stateManagementPolicy"><inject bean="ProducerStateManagementPolicy"/></property>
<property name="stateConverter"><inject bean="ProducerStateConverter"/></property>
18 years
JBoss Portal SVN: r10590 - in branches/JBoss_Portal_Branch_2_7/core/src: resources/portal-core-sar/META-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-04-15 08:14:03 -0400 (Tue, 15 Apr 2008)
New Revision: 10590
Added:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1988: Add a way to clean the navigational state of windows on page refresh
Copied: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java (from rev 10589, branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java 2008-04-15 12:14:03 UTC (rev 10590)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.aspects.controller;
+
+import java.util.Collection;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerInterceptor;
+import org.jboss.portal.core.controller.ControllerResponse;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
+import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
+import org.jboss.portal.core.navstate.NavigationalStateKey;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class CleanNSInterceptor extends ControllerInterceptor
+{
+
+ @Override
+ public ControllerResponse invoke(ControllerCommand cmd) throws Exception, InvocationException
+ {
+ if (cmd instanceof ViewPageCommand)
+ {
+ ViewPageCommand vpc = (ViewPageCommand)cmd;
+ Collection<PortalObject> children = vpc.getPage().getChildren();
+ for (PortalObject portalObject: children)
+ {
+ cmd.removeAttribute(ControllerCommand.NAVIGATIONAL_STATE_SCOPE, new NavigationalStateKey(WindowNavigationalState.class, portalObject.getId()));
+ }
+ }
+ return (ControllerResponse)cmd.invokeNext();
+ }
+
+}
+
Modified: branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2008-04-15 12:06:59 UTC (rev 10589)
+++ branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2008-04-15 12:14:03 UTC (rev 10590)
@@ -167,10 +167,22 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
</mbean>
- <mbean code="org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor"
- name="portal:service=Interceptor,type=Command,name=PortalNode" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <!--
+ This interceptor cleans the Navigation state of windows when the user call a new page or refresh the page
+ -->
+ <mbean
+ code="org.jboss.portal.core.aspects.controller.CleanNSInterceptor"
+ name="portal:service=Interceptor,type=Command,name=CleanNS"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor"
+ name="portal:service=Interceptor,type=Command,name=PortalNode"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
<depends optional-attribute-name="PortalAuthorizationManagerFactory" proxy-type="attribute">
portal:service=PortalAuthorizationManagerFactory
</depends>
@@ -210,6 +222,7 @@
<depends-list optional-attribute-name="InterceptorNames">
<depends-list-element>portal:service=Interceptor,type=Command,name=ResourceAcquisition</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=Ajax</depends-list-element>
+ <!-- depends-list-element>portal:service=Interceptor,type=Command,name=CleanNS</depends-list-element -->
<depends-list-element>portal:service=Interceptor,type=Command,name=NavigationalState</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PortalNode</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PolicyEnforcement</depends-list-element>
18 years
JBoss Portal SVN: r10589 - in branches/JBoss_Portal_Branch_2_6/core/src: main/org/jboss/portal/core/model/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-04-15 08:06:59 -0400 (Tue, 15 Apr 2008)
New Revision: 10589
Added:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1988: Add a way to clean the navigational state of windows on page refresh
Added: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/CleanNSInterceptor.java 2008-04-15 12:06:59 UTC (rev 10589)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.aspects.controller;
+
+import java.util.Collection;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerInterceptor;
+import org.jboss.portal.core.controller.ControllerResponse;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
+import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
+import org.jboss.portal.core.navstate.NavigationalStateKey;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class CleanNSInterceptor extends ControllerInterceptor
+{
+
+ @Override
+ public ControllerResponse invoke(ControllerCommand cmd) throws Exception, InvocationException
+ {
+ if (cmd instanceof ViewPageCommand)
+ {
+ ViewPageCommand vpc = (ViewPageCommand)cmd;
+ Collection<PortalObject> children = vpc.getPage().getChildren();
+ for (PortalObject portalObject: children)
+ {
+ cmd.removeAttribute(ControllerCommand.NAVIGATIONAL_STATE_SCOPE, new NavigationalStateKey(WindowNavigationalState.class, portalObject.getId()));
+ }
+ }
+ return (ControllerResponse)cmd.invokeNext();
+ }
+
+}
+
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2008-04-15 11:45:47 UTC (rev 10588)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2008-04-15 12:06:59 UTC (rev 10589)
@@ -120,14 +120,14 @@
*
* @return the children
*/
- Collection getChildren();
+ Collection<PortalObject> getChildren();
/**
* Return all the children of this object filtered with a particular mask.
*
* @return the children
*/
- Collection getChildren(int mask);
+ Collection<PortalObject> getChildren(int mask);
/**
* Return the parent object.
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2008-04-15 11:45:47 UTC (rev 10588)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2008-04-15 12:06:59 UTC (rev 10589)
@@ -209,7 +209,17 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
</mbean>
+ <!--
+ This interceptor cleans the Navigation state of windows when the user call a new page or refresh the page
+ -->
<mbean
+ code="org.jboss.portal.core.aspects.controller.CleanNSInterceptor"
+ name="portal:service=Interceptor,type=Command,name=CleanNS"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
code="org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor"
name="portal:service=Interceptor,type=Command,name=PortalNode"
xmbean-dd=""
@@ -267,6 +277,7 @@
<depends-list optional-attribute-name="InterceptorNames">
<depends-list-element>portal:service=Interceptor,type=Command,name=ResourceAcquisition</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=Ajax</depends-list-element>
+ <!-- depends-list-element>portal:service=Interceptor,type=Command,name=CleanNS</depends-list-element -->
<depends-list-element>portal:service=Interceptor,type=Command,name=NavigationalState</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PortalNode</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Command,name=PolicyEnforcement</depends-list-element>
18 years
JBoss Portal SVN: r10588 - in branches/JBoss_Portal_Branch_2_7/core: src/main/org/jboss/portal/core/model/portal/navstate and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2008-04-15 07:45:47 -0400 (Tue, 15 Apr 2008)
New Revision: 10588
Modified:
branches/JBoss_Portal_Branch_2_7/core/.classpath
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/navstate/PortalObjectNavigationalStateContext.java
Log:
Some 'boug', not sure when in which use case it happens though...
Modified: branches/JBoss_Portal_Branch_2_7/core/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/.classpath 2008-04-15 11:41:55 UTC (rev 10587)
+++ branches/JBoss_Portal_Branch_2_7/core/.classpath 2008-04-15 11:45:47 UTC (rev 10588)
@@ -56,5 +56,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-federation-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-lib.jar" sourcepath="/module-portlet"/>
<classpathentry kind="lib" path="/thirdparty/portlet/lib/portlet-api.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-controller-lib.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/navstate/PortalObjectNavigationalStateContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/navstate/PortalObjectNavigationalStateContext.java 2008-04-15 11:41:55 UTC (rev 10587)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/navstate/PortalObjectNavigationalStateContext.java 2008-04-15 11:45:47 UTC (rev 10588)
@@ -133,7 +133,8 @@
// If we don't have the old ns then we try the store
if (oldNS == null)
{
- oldNS = store.getAttribute(wantedKey);
+ PortalObjectId id = (PortalObjectId)wantedKey.getId();
+ oldNS = (WindowNavigationalState)store.getAttribute(id.toString());
}
//
18 years