[gatein-commits] gatein SVN: r6737 - in epp/portal/branches/EPP_5_1_WSRP: component/wsrp/src/main/java/conf and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Jun 24 12:38:34 EDT 2011


Author: chris.laprun at jboss.com
Date: 2011-06-24 12:38:34 -0400 (Fri, 24 Jun 2011)
New Revision: 6737

Added:
   epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/conf/wsrp-consumers-config.xml
Modified:
   epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
   epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
   epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
   epp/portal/branches/EPP_5_1_WSRP/pom.xml
Log:
- GTNPORTAL-1938: Made JCRConsumerRegistry able to get its configuration from an InputStream instead of always using the default configuration file.
- Renamed JCRProducerConfigurationService.setDefaultConfigurationIS to setConfigurationIS to be clearer and removed deprecation as it's currently needed.

Added: epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/conf/wsrp-consumers-config.xml
===================================================================
--- epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/conf/wsrp-consumers-config.xml	                        (rev 0)
+++ epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/conf/wsrp-consumers-config.xml	2011-06-24 16:38:34 UTC (rev 6737)
@@ -0,0 +1,94 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!--
+  ~ 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.
+  -->
+
+<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_consumer_1_0 http://www.jboss.org/portal/xsd/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>
+         <registration-data/>
+      </wsrp-producer>
+   </deployment>
+   <deployment>
+      <wsrp-producer id="selfv2" expiration-cache="500" ws-timeout="50000">
+         <endpoint-wsdl-url>http://localhost:8080/wsrp-producer/v2/MarkupService?wsdl</endpoint-wsdl-url>
+         <registration-data/>
+      </wsrp-producer>
+   </deployment>
+   <!--<deployment>
+      <wsrp-producer id="NetUnity" expiration-cache="300">
+         <endpoint-wsdl-url>http://wsrp.netunitysoftware.com/WSRPTestService/WSRPTestService.asmx?Operation=WSDL</endpoint-wsdl-url>
+         <registration-data/>
+      </wsrp-producer>
+   </deployment>-->
+   <!--<deployment>
+      <wsrp-producer id="NetUnityV2" expiration-cache="300">
+         <endpoint-wsdl-url>http://www.netunitysoftware.com/wsrp2interop/WsrpProducer.asmx?Operation=WSDL&WsrpVersion=Two</endpoint-wsdl-url>
+         <registration-data/>
+      </wsrp-producer>
+   </deployment>
+   <deployment>
+      <wsrp-producer id="NetUnityV1" expiration-cache="300">
+         <endpoint-wsdl-url>http://www.netunitysoftware.com/wsrp2interop/WsrpProducer.asmx?Operation=WSDL&WsrpVersion=One</endpoint-wsdl-url>
+         <registration-data/>
+      </wsrp-producer>
+   </deployment>-->
+   <!--<deployment>
+      <wsrp-producer id="vignette" expiration-cache="300">
+         <endpoint-wsdl-url>http://wsrpdemo.vignette.com:8080/producer/wsdl</endpoint-wsdl-url>
+         <registration-data>
+            <property>
+               <name>com.vignette.wsrp.registration.username</name>
+               <lang>en</lang>
+               <value>test</value>
+            </property>
+            <property>
+               <name>com.vignette.wsrp.registration.password</name>
+               <lang>en</lang>
+               <value>test</value>
+            </property>
+         </registration-data>
+      </wsrp-producer>
+   </deployment>-->
+   <!--<deployment>
+      <wsrp-producer id="bea" expiration-cache="300">
+         <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
+         <registration-data>
+            <property>
+               <name>{urn:bea:wlp:prop:reg:registration}consumerRole</name>
+               <lang>en</lang>
+               <value>insider</value>
+            </property>
+         </registration-data>
+      </wsrp-producer>
+   </deployment>-->
+   <!--<deployment>
+      <wsrp-producer id="oracle" expiration-cache="300">
+         <endpoint-wsdl-url>http://portalstandards.oracle.com/portletapp/portlets?WSDL</endpoint-wsdl-url>
+         <registration-data/>
+      </wsrp-producer>
+   </deployment>-->
+</deployments>

Modified: epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
===================================================================
--- epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java	2011-06-24 13:59:39 UTC (rev 6736)
+++ epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java	2011-06-24 16:38:34 UTC (rev 6737)
@@ -88,11 +88,13 @@
    private static final String PRODUCER_CONFIG_LOCATION = "producerConfigLocation";
    private static final String CONSUMERS_CONFIG_LOCATION = "consumersConfigLocation";
 
-   private final InputStream configurationIS;
+   private final InputStream producerConfigurationIS;
    private final String producerConfigLocation;
    private WSRPProducer producer;
 
-   private ConsumerRegistry consumerRegistry;
+   private final InputStream consumersConfigurationIS;
+   private final String consumersConfigLocation;
+   private JCRConsumerRegistry consumerRegistry;
    private ExoContainer container;
    private final ExoKernelIntegration exoKernelIntegration;
    private final boolean bypass;
@@ -106,7 +108,6 @@
 
       // todo: we currently only allow the service to go through initialization if we are running in the default portal
       // as this service is not meant to work with extensions yet...
-      String consumersConfigLocation;
       if ("portal".equals(context.getName()))
       {
          if (params != null)
@@ -120,7 +121,8 @@
                + PRODUCER_CONFIG_LOCATION + "and " + CONSUMERS_CONFIG_LOCATION);
          }
 
-         configurationIS = configurationManager.getInputStream(CLASSPATH + producerConfigLocation);
+         producerConfigurationIS = configurationManager.getInputStream(CLASSPATH + producerConfigLocation);
+         consumersConfigurationIS = configurationManager.getInputStream(CLASSPATH + consumersConfigLocation);
 
          container = context.getContainer();
 
@@ -135,7 +137,8 @@
 
          producerConfigLocation = null;
          consumersConfigLocation = null;
-         configurationIS = null;
+         producerConfigurationIS = null;
+         consumersConfigurationIS = null;
          exoKernelIntegration = null;
          bypass = true;
       }
@@ -165,7 +168,7 @@
       try
       {
          producerConfigurationService = new JCRProducerConfigurationService(container);
-         producerConfigurationService.setDefaultConfigurationIS(configurationIS);
+         producerConfigurationService.setConfigurationIS(producerConfigurationIS);
          producerConfigurationService.reloadConfiguration();
       }
       catch (Exception e)
@@ -282,6 +285,7 @@
          consumerRegistry = new JCRConsumerRegistry(container);
          consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
          consumerRegistry.setSessionEventBroadcaster(sessionEventBroadcaster);
+         consumerRegistry.setConfigurationIS(consumersConfigurationIS);
 
          // create ConsumerStructureProvider and register it to listen to page events
          POMSessionManager sessionManager = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
@@ -305,7 +309,7 @@
       }
       catch (Exception e)
       {
-         throw new RuntimeException("Couldn't start WSRP consumers registry.", e);
+         throw new RuntimeException("Couldn't start WSRP consumers registry from configuration " + consumersConfigLocation, e);
       }
       container.registerComponentInstance(ConsumerRegistry.class, consumerRegistry);
    }

Modified: epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
--- epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java	2011-06-24 13:59:39 UTC (rev 6736)
+++ epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java	2011-06-24 16:38:34 UTC (rev 6737)
@@ -39,6 +39,7 @@
 import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
 import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
 
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -54,6 +55,7 @@
    //   private NewJCRPersister persister;
    private JCRPersister persister;
    private static final String PRODUCER_INFOS_PATH = ProducerInfosMapping.NODE_NAME;
+   private InputStream configurationIS;
 
    public JCRConsumerRegistry(ExoContainer container) throws Exception
    {
@@ -67,6 +69,11 @@
 //      persister = NewJCRPersister.getInstance(container);
    }
 
+   public void setConfigurationIS(InputStream configurationIS)
+   {
+      this.configurationIS = configurationIS;
+   }
+
    @Override
    protected void save(ProducerInfo info, String messageOnError)
    {
@@ -167,7 +174,7 @@
          List<ProducerInfoMapping> infos = producerInfosMapping.getProducerInfos();
 
          // Load from XML
-         XMLConsumerRegistry fromXML = new XMLConsumerRegistry();
+         XMLConsumerRegistry fromXML = new XMLConsumerRegistry(configurationIS);
          fromXML.reloadConsumers();
 
          // Save to JCR

Modified: epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
===================================================================
--- epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java	2011-06-24 13:59:39 UTC (rev 6736)
+++ epp/portal/branches/EPP_5_1_WSRP/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java	2011-06-24 16:38:34 UTC (rev 6737)
@@ -46,7 +46,7 @@
 {
    private static String PRODUCER_CONFIGURATION_PATH = ProducerConfigurationMapping.NODE_NAME;
 
-   private InputStream defaultConfigurationIS;
+   private InputStream configurationIS;
    //   private NewJCRPersister persister;
    private JCRPersister persister;
 
@@ -62,15 +62,9 @@
 //      persister = NewJCRPersister.getInstance(container);
    }
 
-   /**
-    * todo: remove
-    *
-    * @param is
-    * @deprecated this should be removed when a better initialization of default is setup
-    */
-   public void setDefaultConfigurationIS(InputStream is)
+   public void setConfigurationIS(InputStream is)
    {
-      this.defaultConfigurationIS = is;
+      this.configurationIS = is;
    }
 
    protected void loadConfiguration() throws Exception
@@ -84,7 +78,7 @@
       {
          pcm = session.insert(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);
 
-         ProducerConfigurationService service = new SimpleXMLProducerConfigurationService(defaultConfigurationIS);
+         ProducerConfigurationService service = new SimpleXMLProducerConfigurationService(configurationIS);
 
          service.reloadConfiguration();
          configuration = service.getConfiguration();

Modified: epp/portal/branches/EPP_5_1_WSRP/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_WSRP/pom.xml	2011-06-24 13:59:39 UTC (rev 6736)
+++ epp/portal/branches/EPP_5_1_WSRP/pom.xml	2011-06-24 16:38:34 UTC (rev 6737)
@@ -48,7 +48,7 @@
       <org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
       <org.gatein.pc.version>2.2.0-GA</org.gatein.pc.version>
       <org.picketlink.idm>1.1.8.GA</org.picketlink.idm>
-      <org.gatein.wsrp.version>2.0.1-EPP511-CR01</org.gatein.wsrp.version>
+      <org.gatein.wsrp.version>2.0.1-GA-SNAPSHOT</org.gatein.wsrp.version>
       <org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
       <org.slf4j.version>1.5.6</org.slf4j.version>
       <rhino.version>1.6R5</rhino.version>



More information about the gatein-commits mailing list