Author: chris.laprun(a)jboss.com
Date: 2011-09-28 06:11:21 -0400 (Wed, 28 Sep 2011)
New Revision: 7546
Modified:
epp/portal/branches/EPP_5_2_Branch/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
epp/portal/branches/EPP_5_2_Branch/pom.xml
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/resources/conf/wsrp-consumers-config.xml
Log:
- Only use one FederatingPortletInvoker instance instead of having one per portal
container so that WSRP can work in clustered environments.
- Updated to use WSRP 2.1.0-Beta06 and changes to PC 2.3.0-Beta06.
Modified:
epp/portal/branches/EPP_5_2_Branch/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2011-09-28
09:58:15 UTC (rev 7545)
+++
epp/portal/branches/EPP_5_2_Branch/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2011-09-28
10:11:21 UTC (rev 7546)
@@ -27,6 +27,7 @@
import org.gatein.common.logging.LoggerFactory;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.bridge.BridgeInterceptor;
+import org.gatein.pc.federation.FederatedPortletInvoker;
import org.gatein.pc.federation.FederatingPortletInvoker;
import org.gatein.pc.federation.impl.FederatingPortletInvokerService;
import org.gatein.pc.portlet.PortletInvokerInterceptor;
@@ -91,7 +92,7 @@
portletApplicationRegistry = new ExoPortletApplicationDeployer();
portletApplicationRegistry.setContainerPortletInvoker(containerPortletInvoker);
- //
+ // activate schema validation for portlet.xml if needed
String validation =
PropertyManager.getProperty("gatein.portlet.validation");
boolean validated = validation == null ||
"true".equals(validation.trim().toLowerCase());
log.debug("portlet xml validation is " + (validated ? "enabled"
: " disabled"));
@@ -100,9 +101,15 @@
//Container Stack
ContainerPortletDispatcher portletContainerDispatcher = new
ContainerPortletDispatcher();
- // Federating portlet invoker
- FederatingPortletInvoker federatingPortletInvoker = new
FederatingPortletInvokerService();
-
+ // Check if we already have a federating portlet invoker
+ final ExoContainer topContainer = ExoContainerContext.getTopContainer();
+ FederatingPortletInvoker federatingPortletInvoker =
(FederatingPortletInvoker)topContainer.getComponentInstanceOfType(FederatingPortletInvoker.class);
+ if (federatingPortletInvoker == null)
+ {
+ federatingPortletInvoker = new FederatingPortletInvokerService();
+ topContainer.registerComponentInstance(FederatingPortletInvoker.class,
federatingPortletInvoker);
+ }
+
EventPayloadInterceptor eventPayloadInterceptor = new EventPayloadInterceptor();
eventPayloadInterceptor.setNext(portletContainerDispatcher);
RequestAttributeConversationInterceptor requestAttributeConversationInterceptor =
@@ -141,17 +148,21 @@
producerStateManagementPolicy.setPersistLocally(false);
// The producer state converter
- StateConverter producerStateConverter = new
ExoStateConverter();//StateConverterV0();
+ StateConverter producerStateConverter = new ExoStateConverter();
// The producer portlet invoker
ProducerPortletInvoker producerPortletInvoker = new ProducerPortletInvoker();
producerPortletInvoker.setNext(containerPortletInvoker);
- federatingPortletInvoker.registerInvoker(PortletInvoker.LOCAL_PORTLET_INVOKER_ID,
producerPortletInvoker);
-
producerPortletInvoker.setPersistenceManager(producerPersistenceManager);
producerPortletInvoker.setStateManagementPolicy(producerStateManagementPolicy);
producerPortletInvoker.setStateConverter(producerStateConverter);
+ // register the producer portlet invoker if it hasn't been already
+ if(!federatingPortletInvoker.isResolved(PortletInvoker.LOCAL_PORTLET_INVOKER_ID))
+ {
+
federatingPortletInvoker.registerInvoker(PortletInvoker.LOCAL_PORTLET_INVOKER_ID,
producerPortletInvoker);
+ }
+
// The consumer portlet invoker
PortletCustomizationInterceptor portletCustomizationInterceptor = new
PortletCustomizationInterceptor();
portletCustomizationInterceptor.setNext(federatingPortletInvoker);
Modified: epp/portal/branches/EPP_5_2_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-09-28 09:58:15 UTC (rev 7545)
+++ epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-09-28 10:11:21 UTC (rev 7546)
@@ -53,7 +53,7 @@
<org.gatein.wci.version>2.1.0-Beta06</org.gatein.wci.version>
<org.gatein.pc.version>2.3.0-Beta06</org.gatein.pc.version>
<org.picketlink.idm>1.3.0.Alpha04</org.picketlink.idm>
- <org.gatein.wsrp.version>2.1.0-Beta05</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.1.0-Beta06</org.gatein.wsrp.version>
<org.gatein.mop.version>1.1.0-Beta05</org.gatein.mop.version>
<org.gatein.mgmt.version>1.0.0-Beta03</org.gatein.mgmt.version>
<org.slf4j.version>1.5.8</org.slf4j.version>
Modified:
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java 2011-09-28
09:58:15 UTC (rev 7545)
+++
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/WSRPServiceIntegration.java 2011-09-28
10:11:21 UTC (rev 7546)
@@ -30,6 +30,7 @@
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.pc.ExoKernelIntegration;
import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator;
import org.exoplatform.services.listener.ListenerService;
import org.gatein.common.logging.Logger;
@@ -40,6 +41,7 @@
import org.gatein.integration.wsrp.structure.PortalStructureAccess;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.federation.FederatingPortletInvoker;
+import org.gatein.pc.federation.PortletInvokerResolver;
import org.gatein.pc.portlet.PortletInvokerInterceptor;
import org.gatein.pc.portlet.aspects.EventPayloadInterceptor;
import org.gatein.pc.portlet.container.ContainerPortletInvoker;
@@ -61,9 +63,9 @@
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.consumer.migration.JCRMigrationService;
import org.gatein.wsrp.consumer.migration.MigrationService;
-import org.gatein.wsrp.consumer.registry.ActivatingNullInvokerHandler;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import org.gatein.wsrp.consumer.registry.JCRConsumerRegistry;
+import org.gatein.wsrp.consumer.registry.RegisteringPortletInvokerResolver;
import org.gatein.wsrp.payload.WSRPEventPayloadInterceptor;
import org.gatein.wsrp.producer.ProducerHolder;
import org.gatein.wsrp.producer.WSRPProducer;
@@ -184,6 +186,7 @@
}
catch (Exception e)
{
+ log.debug("Couldn't load WSRP producer configuration from " +
producerConfigLocation, e);
throw new RuntimeException("Couldn't load WSRP producer configuration
from " + producerConfigLocation, e);
}
container.registerComponentInstance(ProducerConfigurationService.class,
producerConfigurationService);
@@ -198,6 +201,7 @@
}
catch (Exception e)
{
+ log.debug("Couldn't instantiate RegistrationPersistenceManager",
e);
throw new RuntimeException("Couldn't instantiate
RegistrationPersistenceManager", e);
}
RegistrationManager registrationManager = new RegistrationManagerImpl();
@@ -251,6 +255,7 @@
}
catch (Exception e)
{
+ log.debug("Couldn't instantiate PortletStatePersistenceManager",
e);
throw new RuntimeException("Couldn't instantiate
PortletStatePersistenceManager", e);
}
@@ -327,13 +332,14 @@
consumerRegistry.start();
- // set up a NullInvokerHandler so that when a remote producer is queried, we can
start it if needed
- ActivatingNullInvokerHandler handler = new ActivatingNullInvokerHandler();
- handler.setConsumerRegistry(consumerRegistry);
- federatingPortletInvoker.setNullInvokerHandler(handler);
+ // set up a PortletInvokerResolver so that when a remote producer is queried, we
can start it if needed
+ RegisteringPortletInvokerResolver resolver = new
RegisteringPortletInvokerResolver();
+ resolver.setConsumerRegistry(consumerRegistry);
+ federatingPortletInvoker.setPortletInvokerResolver(resolver);
}
catch (Exception e)
{
+ log.debug(e);
throw new RuntimeException("Couldn't start WSRP consumers registry from
configuration " + consumersConfigLocation, e);
}
container.registerComponentInstance(ConsumerRegistry.class, consumerRegistry);
@@ -370,6 +376,7 @@
}
catch (Exception e)
{
+ log.debug(e);
throw new RuntimeException("Couldn't stop WSRP consumers
registry.", e);
}
Modified:
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/resources/conf/wsrp-consumers-config.xml
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/resources/conf/wsrp-consumers-config.xml 2011-09-28
09:58:15 UTC (rev 7545)
+++
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-component/src/main/resources/conf/wsrp-consumers-config.xml 2011-09-28
10:11:21 UTC (rev 7546)
@@ -25,7 +25,7 @@
<deployments
xmlns="http://www.gatein.org/xml/ns/gatein_wsrp_consumer_1_0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_wsrp_consume...
http://www.jboss.org/portal/xsd/gatein_wsrp_consumer_1_0.xsd">
+
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_wsrp_consume...
http://www.gatein.org/xml/ns/gatein_wsrp_consumer_1_0.xsd">
<deployment>
<wsrp-producer id="selfv1" expiration-cache="500"
ws-timeout="50000">
<endpoint-wsdl-url>http://localhost:8080/wsrp-producer/v1/MarkupService?wsdl</endpoint-wsdl-url>
@@ -91,4 +91,4 @@
<registration-data/>
</wsrp-producer>
</deployment>-->
-</deployments>
\ No newline at end of file
+</deployments>