Author: chris.laprun(a)jboss.com
Date: 2010-10-20 20:14:38 -0400 (Wed, 20 Oct 2010)
New Revision: 4750
Added:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/SerializablePayload.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/SerializableSimplePayload.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/WSRPEventPayloadInterceptor.java
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/PayloadUtils.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java
components/wsrp/trunk/wsrp-producer-war/src/test/producer-sar/portlet-container.war/WEB-INF/jboss-beans.xml
Log:
- GTNWSRP-67: Re-considered approach of event payload handling: encapsulate them in
SerializablePayload classes and deal with them in a specific PortletInvokerInterceptor
since
we can get access to the portlet application class loader there so that we don't
need to deploy the event classes separately on the consumer anymore.
- NetUnity producer event test portlets should now work properly as well.
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/PayloadUtils.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/PayloadUtils.java 2010-10-21
00:06:10 UTC (rev 4749)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/PayloadUtils.java 2010-10-21
00:14:38 UTC (rev 4750)
@@ -24,7 +24,6 @@
package org.gatein.wsrp.payload;
import org.gatein.common.util.ParameterValidation;
-import org.gatein.pc.api.info.EventInfo;
import org.gatein.wsrp.WSRPTypeFactory;
import org.oasis.wsrp.v2.Event;
import org.oasis.wsrp.v2.EventPayload;
@@ -36,7 +35,6 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.Serializable;
@@ -50,7 +48,6 @@
public class PayloadUtils
{
private final static Map<String, XSDTypeConverter> typeToConverters = new
HashMap<String, XSDTypeConverter>(19);
- private final static Map<QName, XSDTypeConverter> nameToConverters = new
HashMap<QName, XSDTypeConverter>(5);
private final static Map<Class, XSDTypeConverter> classToConverters = new
HashMap<Class, XSDTypeConverter>(19);
static
@@ -70,9 +67,8 @@
}
}
- public static Serializable getPayloadAsSerializable(Event event, EventInfo eventInfo)
+ public static Serializable getPayloadAsSerializable(Event event)
{
- // GTNWSRP-49
EventPayload payload = event.getPayload();
if (payload == null)
{
@@ -98,39 +94,25 @@
{
Element element = (Element)any;
QName type = event.getType();
- String typeName = type.getLocalPart();
- if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getNamespaceURI()))
+ if (type != null)
{
- // if we want a default simple datatype, convert it directly
- XSDTypeConverter converter = typeToConverters.get(typeName);
- if (converter == null)
- {
- throw new IllegalArgumentException("Don't know how to deal with
standard type: " + type);
- }
+ String typeName = type.getLocalPart();
- // record which converter was used so that we can use it when it's time
to marshall it back to XML
- nameToConverters.put(event.getName(), converter);
-
- return converter.parseFromXML(element.getTextContent());
- }
- else
- {
- // attempt to load the payload as a java class whose name is the type local
part
- try
+ if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getNamespaceURI()))
{
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class<? extends Serializable> clazz =
loader.loadClass(typeName).asSubclass(Serializable.class);
- JAXBContext jaxbContext = JAXBContext.newInstance(clazz);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- JAXBElement result = unmarshaller.unmarshal(element, clazz);
- return (Serializable)result.getValue();
+ // if we want a default simple datatype, convert it directly
+ XSDTypeConverter converter = typeToConverters.get(typeName);
+ if (converter == null)
+ {
+ throw new IllegalArgumentException("Don't know how to deal
with standard type: " + type);
+ }
+
+ return new SerializableSimplePayload(element,
converter.parseFromXML(element.getTextContent()), converter);
}
- catch (Exception e)
- {
- throw new IllegalArgumentException("Couldn't unmarshall element
" + element + " with expected type " + event, e);
- }
}
+
+ return new SerializablePayload(element);
}
}
@@ -141,37 +123,26 @@
SerializableNamedStringArray stringArray =
(SerializableNamedStringArray)payload;
return
WSRPTypeFactory.createEventPayloadAsNamedString(stringArray.toNamedStringArray());
}
+ else if (payload instanceof SerializablePayload)
+ {
+ if (payload instanceof SerializableSimplePayload)
+ {
+
eventNeedingType.setType(((SerializableSimplePayload)payload).getConverter().getXSDType());
+ }
+ return
WSRPTypeFactory.createEventPayloadAsAny(((SerializablePayload)payload).getElement());
+ }
else
{
- // todo: complete GTNWSRP-49
- QName name = eventNeedingType.getName();
-
- // we will use the payload class name as type for serialiation if we can't
find something better...
Class payloadClass = payload.getClass();
- QName type = new QName(payloadClass.getName());
-
- // first, try to get a converter from the event name and use the converter type
- XSDTypeConverter converter = nameToConverters.get(name);
+ // try to get a converter from the payload class to assert a simple XSD type if
possible
+ XSDTypeConverter converter = classToConverters.get(payloadClass);
if (converter != null)
{
- // remove from map to avoid memory leak
- nameToConverters.remove(name);
-
- type = converter.getXSDType();
+ eventNeedingType.setType(converter.getXSDType());
}
- else
- {
- // otherwise, try to get a converter from the payload class
- converter = classToConverters.get(payloadClass);
- if (converter != null)
- {
- type = converter.getXSDType();
- }
- }
-
- // else, use the class name as type for the serialization
- eventNeedingType.setType(type);
+ // Marshall payload to XML
+ QName name = eventNeedingType.getName();
try
{
JAXBContext context = JAXBContext.newInstance(payloadClass);
@@ -186,7 +157,7 @@
}
catch (Exception e)
{
- throw new IllegalArgumentException("Couldn't marshall payload "
+ payload + " with expected type " + type, e);
+ throw new IllegalArgumentException("Couldn't marshall payload "
+ payload, e);
}
}
}
Added:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/SerializablePayload.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/SerializablePayload.java
(rev 0)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/SerializablePayload.java 2010-10-21
00:14:38 UTC (rev 4750)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.payload;
+
+import org.w3c.dom.Element;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class SerializablePayload implements Serializable
+{
+ protected final Element element;
+
+ public SerializablePayload(Element element)
+ {
+ this.element = element;
+ }
+
+ public Element getElement()
+ {
+ return element;
+ }
+}
Added:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/SerializableSimplePayload.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/SerializableSimplePayload.java
(rev 0)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/SerializableSimplePayload.java 2010-10-21
00:14:38 UTC (rev 4750)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.payload;
+
+import org.w3c.dom.Element;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class SerializableSimplePayload extends SerializablePayload
+{
+ private final Serializable payload;
+ private final XSDTypeConverter converter;
+
+ public SerializableSimplePayload(Element element, Serializable payload,
XSDTypeConverter converter)
+ {
+ super(element);
+ this.payload = payload;
+ this.converter = converter;
+ }
+
+ public Serializable getPayload()
+ {
+ return payload;
+ }
+
+ public XSDTypeConverter getConverter()
+ {
+ return converter;
+ }
+}
Added:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/WSRPEventPayloadInterceptor.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/WSRPEventPayloadInterceptor.java
(rev 0)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/WSRPEventPayloadInterceptor.java 2010-10-21
00:14:38 UTC (rev 4750)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.gatein.wsrp.payload;
+
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.pc.api.info.EventInfo;
+import org.gatein.pc.api.info.EventingInfo;
+import org.gatein.pc.api.info.PortletInfo;
+import org.gatein.pc.api.invocation.EventInvocation;
+import org.gatein.pc.api.invocation.PortletInvocation;
+import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
+import org.gatein.pc.portlet.PortletInvokerInterceptor;
+import org.gatein.pc.portlet.container.ContainerPortletInvoker;
+import org.gatein.pc.portlet.container.PortletApplication;
+import org.gatein.pc.portlet.container.PortletApplicationContext;
+import org.gatein.pc.portlet.container.PortletContainer;
+import org.gatein.pc.portlet.impl.info.ContainerTypeInfo;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class WSRPEventPayloadInterceptor extends PortletInvokerInterceptor
+{
+ /** . */
+ private final static Logger log =
LoggerFactory.getLogger(WSRPEventPayloadInterceptor.class);
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
IllegalArgumentException, PortletInvokerException
+ {
+ if (invocation instanceof EventInvocation)
+ {
+ EventInvocation eventInvocation = (EventInvocation)invocation;
+
+ Serializable srcPayload = eventInvocation.getPayload();
+
+ Serializable dstPayload = srcPayload;
+
+
+ if (srcPayload instanceof SerializablePayload)
+ {
+ PortletContainer container =
(PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
+ String containerId = container.getId();
+ QName eventName = eventInvocation.getName();
+
+ boolean trace = log.isTraceEnabled();
+
+ // get the event metadata from the portlet metadata
+ PortletInfo info = container.getInfo();
+ EventingInfo eventingInfo = info.getEventing();
+ Map<QName, ? extends EventInfo> consumedEventInfos =
eventingInfo.getConsumedEvents();
+ EventInfo eventInfo = consumedEventInfos.get(eventName);
+
+ Class dstPayloadClass;
+ if (eventInfo != null)
+ {
+ // get the type of the event
+ ContainerTypeInfo typeInfo = (ContainerTypeInfo)eventInfo.getType();
+
+ if (typeInfo != null)
+ {
+ // if we managed to get the event type information, try to unmarshall
the event from the XML payload
+ dstPayloadClass = typeInfo.getType();
+ if (trace)
+ {
+ log.trace("Obtained for event " + eventName + " its
payload class " + dstPayloadClass.getName() + " declared by the portlet meta
data "
+ + containerId);
+ }
+
+ // get the portlet application class loader so we can access the war
classes
+ PortletApplication application = container.getPortletApplication();
+ PortletApplicationContext applicationContext =
application.getContext();
+ ClassLoader loader = applicationContext.getClassLoader();
+
+ if (srcPayload instanceof SerializableSimplePayload)
+ {
+ dstPayload = ((SerializableSimplePayload)srcPayload).getPayload();
+ }
+ else
+ {
+ SerializablePayload scp = (SerializablePayload)srcPayload;
+
+ try
+ {
+ Class<? extends Serializable> clazz =
loader.loadClass(dstPayloadClass.getName()).asSubclass(Serializable.class);
+ JAXBContext jaxbContext = JAXBContext.newInstance(clazz);
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ JAXBElement<? extends Serializable> result =
unmarshaller.unmarshal(scp.getElement(), clazz);
+
+ dstPayload = result.getValue();
+ }
+ catch (Exception e)
+ {
+ throw new PortletInvokerException("Couldn't unmarshall
event from payload!", e);
+ }
+ }
+ }
+ else
+ {
+ if (trace)
+ {
+ log.trace("No type declared for event " + eventName +
" declared by the portlet meta data " + containerId);
+ }
+ }
+ }
+
+ }
+
+ // Set payload
+ eventInvocation.setPayload(dstPayload);
+
+ //
+ try
+ {
+ return super.invoke(invocation);
+ }
+ finally
+ {
+ eventInvocation.setPayload(srcPayload);
+ }
+ }
+ else
+ {
+ return super.invoke(invocation);
+ }
+ }
+}
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java 2010-10-21
00:06:10 UTC (rev 4749)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java 2010-10-21
00:14:38 UTC (rev 4750)
@@ -26,7 +26,6 @@
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.OpaqueStateString;
import org.gatein.pc.api.StateEvent;
-import org.gatein.pc.api.info.EventInfo;
import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
import org.gatein.pc.api.spi.InstanceContext;
@@ -97,12 +96,11 @@
{
for (Event event : events)
{
- EventInfo eventInfo =
consumer.getProducerInfo().getInfoForEvent(event.getName());
Serializable payloadAsSerializable = null;
boolean failedPayload = false;
try
{
- payloadAsSerializable = PayloadUtils.getPayloadAsSerializable(event,
eventInfo);
+ payloadAsSerializable = PayloadUtils.getPayloadAsSerializable(event);
}
catch (Exception e)
{
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java
===================================================================
---
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java 2010-10-21
00:06:10 UTC (rev 4749)
+++
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java 2010-10-21
00:14:38 UTC (rev 4750)
@@ -149,7 +149,7 @@
Event event = events.get(0);
eventInvocation.setName(event.getName());
- eventInvocation.setPayload(PayloadUtils.getPayloadAsSerializable(event, null));
+ eventInvocation.setPayload(PayloadUtils.getPayloadAsSerializable(event));
return eventInvocation;
}
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java 2010-10-21
00:06:10 UTC (rev 4749)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java 2010-10-21
00:14:38 UTC (rev 4750)
@@ -30,6 +30,7 @@
import org.gatein.wsrp.WSRPRenderURL;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.payload.PayloadUtils;
+import org.gatein.wsrp.payload.SerializableSimplePayload;
import org.gatein.wsrp.producer.WSRPProducerBaseTest;
import org.gatein.wsrp.servlet.ServletAccess;
import org.gatein.wsrp.test.ExtendedAssert;
@@ -68,6 +69,7 @@
import org.oasis.wsrp.v2.UpdateResponse;
import javax.xml.namespace.QName;
+import java.io.Serializable;
import java.rmi.RemoteException;
import java.util.List;
import java.util.Locale;
@@ -843,8 +845,11 @@
Event event = events.get(0);
assertEquals(new QName("urn:jboss:gatein:samples:event",
"eventsample"), event.getName());
assertEquals(WSRPConstants.XSD_STRING, event.getType());
- assertEquals("param-value",
PayloadUtils.getPayloadAsSerializable(event, null));
+ Serializable serializable = PayloadUtils.getPayloadAsSerializable(event);
+ assertTrue(serializable instanceof SerializableSimplePayload);
+ assertEquals("param-value",
((SerializableSimplePayload)serializable).getPayload());
+
// send event
HandleEvents handleEvents = WSRPTypeFactory.createHandleEvents(null,
WSRPTypeFactory.createPortletContext(consumerHandle),
createDefaultRuntimeContext(), null,
Modified:
components/wsrp/trunk/wsrp-producer-war/src/test/producer-sar/portlet-container.war/WEB-INF/jboss-beans.xml
===================================================================
---
components/wsrp/trunk/wsrp-producer-war/src/test/producer-sar/portlet-container.war/WEB-INF/jboss-beans.xml 2010-10-21
00:06:10 UTC (rev 4749)
+++
components/wsrp/trunk/wsrp-producer-war/src/test/producer-sar/portlet-container.war/WEB-INF/jboss-beans.xml 2010-10-21
00:14:38 UTC (rev 4750)
@@ -1,32 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2010, 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.
+ -->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
<bean name="PortletApplicationDeployer"
class="org.gatein.pc.mc.PortletApplicationDeployer">
<alias>PortletApplicationRegistry</alias>
- <property name="servletContainerFactory"><inject
bean="ServletContainerFactory"/></property>
- <property name="containerPortletInvoker"><inject
bean="ContainerPortletInvoker"/></property>
+ <property name="servletContainerFactory">
+ <inject bean="ServletContainerFactory"/>
+ </property>
+ <property name="containerPortletInvoker">
+ <inject bean="ContainerPortletInvoker"/>
+ </property>
</bean>
<!-- The ServletContainerFactory -->
@@ -42,11 +46,14 @@
</bean>
<!-- The producer persistence manager -->
- <bean name="ProducerPersistenceManager"
class="org.gatein.pc.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
+ <bean name="ProducerPersistenceManager"
+
class="org.gatein.pc.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
<!-- The producer state management policy -->
<bean name="ProducerStateManagementPolicy"
class="org.gatein.pc.portlet.impl.state.StateManagementPolicyService">
- <property
name="persistLocally"><value>true</value></property>
+ <property name="persistLocally">
+ <value>true</value>
+ </property>
</bean>
<!-- The producer state converter -->
@@ -54,51 +61,86 @@
<!-- The consumer portlet invoker -->
<bean name="ConsumerPortletInvoker"
class="org.gatein.pc.portlet.PortletInvokerInterceptor">
- <property name="next"><inject
bean="ConsumerCacheInterceptor"/></property>
+ <property name="next">
+ <inject bean="ConsumerCacheInterceptor"/>
+ </property>
</bean>
<bean name="ConsumerCacheInterceptor"
class="org.gatein.pc.portlet.aspects.ConsumerCacheInterceptor">
- <property name="next"><inject
bean="PortletCustomizationInterceptor"/></property>
+ <property name="next">
+ <inject bean="PortletCustomizationInterceptor"/>
+ </property>
</bean>
<bean name="PortletCustomizationInterceptor"
class="org.gatein.pc.portlet.aspects.PortletCustomizationInterceptor">
- <property name="next"><inject
bean="ProducerPortletInvoker"/></property>
+ <property name="next">
+ <inject bean="ProducerPortletInvoker"/>
+ </property>
</bean>
<!-- The producer portlet invoker -->
<bean name="ProducerPortletInvoker"
class="org.gatein.pc.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>
+ <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 portlet container invoker -->
<bean name="ContainerPortletInvoker"
class="org.gatein.pc.portlet.container.ContainerPortletInvoker">
- <property name="next"><inject
bean="ValveInterceptor"/></property>
+ <property name="next">
+ <inject bean="ValveInterceptor"/>
+ </property>
</bean>
<!-- Container stack -->
<bean name="ValveInterceptor"
class="org.gatein.pc.portlet.aspects.ValveInterceptor">
- <property name="portletApplicationRegistry"><inject
bean="PortletApplicationRegistry"
state="Instantiated"/></property>
- <property name="next"><inject
bean="SecureTransportInterceptor"/></property>
+ <property name="portletApplicationRegistry">
+ <inject bean="PortletApplicationRegistry"
state="Instantiated"/>
+ </property>
+ <property name="next">
+ <inject bean="SecureTransportInterceptor"/>
+ </property>
</bean>
<bean name="SecureTransportInterceptor"
class="org.gatein.pc.portlet.aspects.SecureTransportInterceptor">
- <property name="next"><inject
bean="ContextDispatcherInterceptor"/></property>
+ <property name="next">
+ <inject bean="ContextDispatcherInterceptor"/>
+ </property>
</bean>
<bean name="ContextDispatcherInterceptor"
class="org.gatein.pc.portlet.aspects.ContextDispatcherInterceptor">
- <property name="servletContainerFactory"><inject
bean="ServletContainerFactory"/></property>
- <property name="next"><inject
bean="ProducerCacheInterceptor"/></property>
+ <property name="servletContainerFactory">
+ <inject bean="ServletContainerFactory"/>
+ </property>
+ <property name="next">
+ <inject bean="ProducerCacheInterceptor"/>
+ </property>
</bean>
<bean name="ProducerCacheInterceptor"
class="org.gatein.pc.portlet.aspects.ProducerCacheInterceptor">
- <property name="next"><inject
bean="CCPPInterceptor"/></property>
+ <property name="next">
+ <inject bean="CCPPInterceptor"/>
+ </property>
</bean>
<bean name="CCPPInterceptor"
class="org.gatein.pc.portlet.aspects.CCPPInterceptor">
- <property name="next"><inject
bean="RequestAttributeConversationInterceptor"/></property>
+ <property name="next">
+ <inject bean="RequestAttributeConversationInterceptor"/>
+ </property>
</bean>
- <bean name="RequestAttributeConversationInterceptor"
class="org.gatein.pc.portlet.aspects.RequestAttributeConversationInterceptor">
- <property name="next"><inject
bean="EventPayloadInterceptor"/></property>
+ <bean name="RequestAttributeConversationInterceptor"
+
class="org.gatein.pc.portlet.aspects.RequestAttributeConversationInterceptor">
+ <property name="next">
+ <inject bean="EventPayloadInterceptor"/>
+ </property>
</bean>
- <bean name="EventPayloadInterceptor"
class="org.gatein.pc.portlet.aspects.EventPayloadInterceptor">
- <property name="next"><inject
bean="PortletContainerDispatcher"/></property>
+ <bean name="EventPayloadInterceptor"
class="org.gatein.wsrp.payload.WSRPEventPayloadInterceptor">
+ <property name="next">
+ <inject bean="PortletContainerDispatcher"/>
+ </property>
</bean>
<bean name="PortletContainerDispatcher"
class="org.gatein.pc.portlet.container.ContainerPortletDispatcher">
</bean>