[portal-commits] JBoss Portal SVN: r5950 - in trunk: portlet/src/main/org/jboss/portal/portlet/state wsrp/src/main/org/jboss/portal/test/wsrp wsrp/src/main/org/jboss/portal/test/wsrp/deployment wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors wsrp/src/main/org/jboss/portal/wsrp wsrp/src/main/org/jboss/portal/wsrp/consumer wsrp/src/main/org/jboss/portal/wsrp/deployment wsrp/src/main/org/jboss/portal/wsrp/registration wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers wsrp/src/resources/tests/test-deployment-lib-jar

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Sun Jan 7 21:49:53 EST 2007


Author: chris.laprun at jboss.com
Date: 2007-01-07 21:49:44 -0500 (Sun, 07 Jan 2007)
New Revision: 5950

Added:
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
Modified:
   trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java
   trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java
   trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
   trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
   trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerService.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java
   trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java
   trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp
   trunk/wsrp/src/resources/tests/test-deployment-lib-jar/test-wsrp.xml
Log:
- Extracted handling of service description from Consumer to a ProducerInfo.
- Improved behavior of service description and cache handling.
- Updated deployment code to create the appropriate objects when creating a Consumer.
- Updated deployment tests for new Consumer information architecture.
- Added testInvalidHandle in MarkupTestCase.
- Changed behavior of WSRPConsumerImpl.getPortletInfo where an inexisting portlet was failing silently.
- Use BEA's producer in deployment tests (Oracle's was/is down).

Modified: trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/state/Property.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -32,10 +32,10 @@
 {
 
    /** The property name. */
-   private String name;
+   protected String name;
 
    /** The property value. */
-   private Value value;
+   protected Value value;
 
    public Property(String name, Value value)
    {

Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPConsumerBaseTest.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -54,7 +54,8 @@
 
    public void setUp() throws Exception
    {
-      consumer.setProducerId(TEST_PRODUCER_ID);
+      consumer.getProducerInfo().setId(TEST_PRODUCER_ID);
+      producer.reset();
    }
 
    public TestWSRPProducer getProducer()

Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -25,6 +25,9 @@
 import junit.framework.TestCase;
 import org.jboss.portal.wsrp.WSRPConstants;
 import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
+import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
 import org.jboss.portal.wsrp.core.Property;
 import org.jboss.portal.wsrp.core.RegistrationData;
 import org.jboss.portal.wsrp.deployment.WSRPConsumerService;
@@ -69,6 +72,11 @@
       WSRPConsumerService service1 = (WSRPConsumerService)service;
       assertEquals("endpoint1", service1.getId());
       WSRPConsumer consumer1 = service1.getConsumer();
+      ProducerInfo info = consumer1.getProducerInfo();
+      assertNotNull(info);
+      assertEquals(service1.getId(), info.getId());
+      EndpointConfigurationInfo endInfo = info.getEndpointConfigurationInfo();
+      assertNotNull(endInfo);
       assertNotNull(consumer1.getServiceFactory());
       assertTrue(consumer1.getServiceFactory() instanceof PerEndpointSOAPInvokerServiceFactory);
       PerEndpointSOAPInvokerServiceFactory serviceFactory1 = (PerEndpointSOAPInvokerServiceFactory)consumer1.getServiceFactory();
@@ -76,6 +84,10 @@
       assertEquals("markup-1", serviceFactory1.getMarkupURL());
       assertEquals("registration-1", serviceFactory1.getRegistrationURL());
       assertEquals("portlet-management-1", serviceFactory1.getPortletManagementURL());
+      assertEquals(endInfo.getServiceDescriptionInterfaceURL(), serviceFactory1.getServiceDescriptionURL());
+      assertEquals(endInfo.getMarkupInterfaceURL(), serviceFactory1.getMarkupURL());
+      assertEquals(endInfo.getRegistrationInterfaceURL(), serviceFactory1.getRegistrationURL());
+      assertEquals(endInfo.getPortletManagementInterfaceURL(), serviceFactory1.getPortletManagementURL());
 
       //
       service = services.get(1);
@@ -96,13 +108,18 @@
       WSRPConsumerService service3 = (WSRPConsumerService)service;
       assertEquals("producer1", service3.getId());
       WSRPConsumer consumer3 = service3.getConsumer();
-      assertEquals(120, consumer3.getExpirationCacheSeconds().intValue());
+      info = consumer3.getProducerInfo();
+      assertEquals(120, info.getExpirationCacheSeconds().intValue());
       ServiceFactory serviceFactory = consumer3.getServiceFactory();
       assertNotNull(serviceFactory);
       assertTrue(serviceFactory instanceof RemoteSOAPInvokerServiceFactory);
-      RemoteSOAPInvokerServiceFactory remoteServiceFactory = (RemoteSOAPInvokerServiceFactory)serviceFactory;
-      assertEquals("http://portalstandards.oracle.com/portletapp/portlets?WSDL", remoteServiceFactory.getWsdlDefinitionURL());
-      RegistrationData registrationData = consumer3.getRegistrationData();
+      endInfo = info.getEndpointConfigurationInfo();
+      assertNotNull(endInfo);
+      assertTrue(endInfo.usesWSDL());
+      assertEquals("http://wsrp.bea.com:7001/producer/producer?WSDL", endInfo.getWSDLLocationIfAvailable());
+      RegistrationInfo regInfo = info.getRegistrationInfo();
+      assertNotNull(regInfo);
+      RegistrationData registrationData = regInfo.getRegistrationData();
       assertNotNull(registrationData);
       assertEquals("JBoss Portal 2.4 Test", registrationData.getConsumerName());
       assertEquals(WSRPConstants.CONSUMER_AGENT, registrationData.getConsumerAgent());
@@ -121,7 +138,7 @@
       service3 = (WSRPConsumerService)service;
       assertEquals("producer2", service3.getId());
       consumer3 = service3.getConsumer();
-      registrationData = consumer3.getRegistrationData();
+      registrationData = consumer3.getProducerInfo().getRegistrationInfo().getRegistrationData();
       assertNotNull(registrationData);
       assertNotNull(registrationData.getConsumerName());
       assertEquals(WSRPConstants.CONSUMER_AGENT, registrationData.getConsumerAgent());

Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -27,6 +27,7 @@
 import org.jboss.portal.WindowState;
 import org.jboss.portal.common.junit.ExtendedAssert;
 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.PortletInvocation;
 import org.jboss.portal.portlet.invocation.RenderInvocation;
@@ -61,6 +62,18 @@
       super();
    }
 
+   public void testInvalidHandle()
+   {
+      try
+      {
+         consumer.invoke(createRenderInvocation("Invalid portlet handle"));
+         ExtendedAssert.fail("Should have failed on invalid portlet handle");
+      }
+      catch (PortletInvokerException expected)
+      {
+      }
+   }
+
    public void testEmptyRender() throws Exception
    {
       checkRenderResult(consumer.invoke(createRenderInvocation(EmptyMarkupBehavior.PORTLET_HANDLE)), "");

Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/behaviors/BasicPortletManagementBehavior.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -81,7 +81,9 @@
       String handle = getHandleFrom(getPortletDescription.getPortletContext(), "GetPortletDescription");
 
       String suffix;
-      if (handle.startsWith(BasicMarkupBehavior.PORTLET_HANDLE))
+      if (handle.startsWith(BasicMarkupBehavior.PORTLET_HANDLE)
+         || NullMarkupBehavior.PORTLET_HANDLE.equals(handle)
+         || EmptyMarkupBehavior.PORTLET_HANDLE.equals(handle))
       {
          suffix = "";
       }

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -24,10 +24,8 @@
 
 import org.jboss.portal.portlet.PortletInvoker;
 import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
+import org.jboss.portal.wsrp.consumer.ProducerInfo;
 import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
-import org.jboss.portal.wsrp.consumer.RegistrationInfo;
-import org.jboss.portal.wsrp.core.RegistrationData;
 import org.jboss.portal.wsrp.services.ServiceFactory;
 import org.jboss.system.Service;
 
@@ -42,13 +40,6 @@
 public interface WSRPConsumer extends PortletInvoker, Service
 {
    /**
-    * Sets the identifier for the producer this consumer is associated with.
-    *
-    * @param id the identifier of the associated producer
-    */
-   void setProducerId(String id);
-
-   /**
     * Retrieves the identifier for the producer this consumer is associated with.
     *
     * @return the identifier of the associated producer
@@ -70,34 +61,6 @@
    ServiceFactory getServiceFactory();
 
    /**
-    * Sets the cache expiration duration (in seconds) for cached values.
-    *
-    * @param expirationCacheSeconds the cache expiration duration (in seconds)
-    */
-   void setExpirationCacheSeconds(Integer expirationCacheSeconds);
-
-   /**
-    * Retrieves the cache expiration duration (in seconds) for cached values.
-    *
-    * @return Sets the cache expiration duration (in seconds) for cached values.
-    */
-   Integer getExpirationCacheSeconds();
-
-   /**
-    * Sets the registration data used to register this consumer with the associated producer
-    *
-    * @param registrationData the registration data used to register this consumer with the associated producer
-    */
-   void setRegistrationData(RegistrationData registrationData);
-
-   /**
-    * Retrieves the registration data used to register this consumer with the associated producer
-    *
-    * @return the registration data used to register this consumer with the associated producer
-    */
-   RegistrationData getRegistrationData();
-
-   /**
     * Retrieves the session information for the producer associated with this consumer.
     *
     * @param invocation a portlet invocation from which the session information should be extracted.
@@ -116,18 +79,14 @@
    ProducerSessionInformation getProducerSessionInformationFrom(HttpSession session);
 
    /**
-    * Retrieves the registration information associated with this consumer.
-    *
     * @return
     * @since 2.6
     */
-   RegistrationInfo getRegistrationInfo();
+   ProducerInfo getProducerInfo();
 
    /**
-    * Retrieves the configuration information for the WSRP endpoints of the associated remote producer.
-    *
-    * @return
+    * @param producerInfo
     * @since 2.6
     */
-   EndpointConfigurationInfo getEndpointConfigurationInfo();
+   void setProducerInfo(ProducerInfo producerInfo);
 }

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPUtils.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -349,17 +349,56 @@
    }
 
    /**
-    *
     * @param propertyDescription
     * @return
     * @since 2.6
     */
-   /*public static RegistrationPropertyDescription convertToRegistrationPropertyDescription(PropertyDescription propertyDescription)
+   public static RegistrationPropertyDescription convertToRegistrationPropertyDescription(PropertyDescription propertyDescription)
    {
       ParameterValidation.throwIllegalArgExceptionIfNull(propertyDescription, "PropertyDescription");
-   }*/
+      RegistrationPropertyDescription desc = new RegistrationPropertyDescription(propertyDescription.getName(),
+         propertyDescription.getType());
+      desc.setLabel(getLocalizedStringOrNull(propertyDescription.getLabel()));
+      desc.setHint(getLocalizedStringOrNull(propertyDescription.getHint()));
 
+      return desc;
+   }
+
+   private static LocalizedString getLocalizedStringOrNull(org.jboss.portal.wsrp.core.LocalizedString wsrpLocalizedString)
+   {
+      if (wsrpLocalizedString == null)
+      {
+         return null;
+      }
+      else
+      {
+         return convertToLocalizedString(wsrpLocalizedString);
+      }
+   }
+
    /**
+    * @param wsrpLocalizedString
+    * @return
+    * @since 2.6
+    */
+   public static LocalizedString convertToLocalizedString(org.jboss.portal.wsrp.core.LocalizedString wsrpLocalizedString)
+   {
+      ParameterValidation.throwIllegalArgExceptionIfNull(wsrpLocalizedString, "WSRP LocalizedString");
+      String lang = wsrpLocalizedString.getLang();
+      Locale locale;
+      if (lang == null)
+      {
+         locale = Locale.getDefault();
+      }
+      else
+      {
+         locale = LocaleInfo.decodeLocaleInfoFromRFC3066LanguageTag(lang).getLocale();
+      }
+
+      return new LocalizedString(wsrpLocalizedString.getValue(), locale);
+   }
+
+   /**
     * @param regLocalizedString
     * @return
     * @since 2.6

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -65,6 +65,8 @@
 
    protected Object prepareRequest(RequestPrecursor requestPrecursor, PortletInvocation invocation)
    {
+      log.debug("Consumer about to attempt rendering portlet '" + requestPrecursor.portletHandle + "'");
+
       // access mode
       InstanceContext instanceContext = invocation.getInstanceContext();
       ParameterValidation.throwIllegalArgExceptionIfNull(instanceContext, "instance context");

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -24,7 +24,11 @@
 package org.jboss.portal.wsrp.consumer;
 
 import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.portlet.InvokerUnavailableException;
+import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
+import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
+import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
+import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
 import org.jboss.portal.wsrp.services.RemoteSOAPInvokerServiceFactory;
 import org.jboss.portal.wsrp.services.ServiceFactory;
 
@@ -36,24 +40,34 @@
 public class EndpointConfigurationInfo
 {
    private ServiceFactory serviceFactory;
+   static final String SERVICE_DESCRIPTION = "service description";
+   static final String MARKUP = "markup";
+   static final String PORTLET_MANAGEMENT = "portlet management";
+   static final String REGISTRATION = "registration";
 
 
-   public EndpointConfigurationInfo(WSRPConsumer consumer)
+   public EndpointConfigurationInfo(ProducerInfo producerInfo)
    {
-      ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "WSRPConsumer");
-      serviceFactory = consumer.getServiceFactory();
+      ParameterValidation.throwIllegalArgExceptionIfNull(producerInfo, "ProducerInfo");
+      producerInfo.setEndpointConfigurationInfo(this);
    }
 
+   public EndpointConfigurationInfo(ProducerInfo producerInfo, ServiceFactory serviceFactory)
+   {
+      this(producerInfo);
+      setServiceFactory(serviceFactory);
+   }
+
    public boolean usesWSDL()
    {
-      return serviceFactory instanceof RemoteSOAPInvokerServiceFactory;
+      return getServiceFactory() instanceof RemoteSOAPInvokerServiceFactory;
    }
 
    public String getWSDLLocationIfAvailable()
    {
       if (usesWSDL())
       {
-         RemoteSOAPInvokerServiceFactory remoteSF = (RemoteSOAPInvokerServiceFactory)serviceFactory;
+         RemoteSOAPInvokerServiceFactory remoteSF = (RemoteSOAPInvokerServiceFactory)getServiceFactory();
          return remoteSF.getWsdlDefinitionURL();
       }
       else
@@ -64,21 +78,69 @@
 
    public String getServiceDescriptionInterfaceURL()
    {
-      return serviceFactory.getServiceDescriptionURL();
+      return getServiceFactory().getServiceDescriptionURL();
    }
 
    public String getMarkupInterfaceURL()
    {
-      return serviceFactory.getMarkupURL();
+      return getServiceFactory().getMarkupURL();
    }
 
    public String getPortletManagementInterfaceURL()
    {
-      return serviceFactory.getPortletManagementURL();
+      return getServiceFactory().getPortletManagementURL();
    }
 
    public String getRegistrationInterfaceURL()
    {
-      return serviceFactory.getRegistrationURL();
+      return getServiceFactory().getRegistrationURL();
    }
+
+   ServiceFactory getServiceFactory()
+   {
+      if (serviceFactory == null)
+      {
+         throw new IllegalStateException("ServiceFactory hasn't been initialized for this EndpointConfigurationInfo");
+      }
+      return serviceFactory;
+   }
+
+   void setServiceFactory(ServiceFactory serviceFactory)
+   {
+      ParameterValidation.throwIllegalArgExceptionIfNull(serviceFactory, "ServiceFactory");
+      this.serviceFactory = serviceFactory;
+   }
+
+   WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws InvokerUnavailableException
+   {
+      return (WSRP_v1_ServiceDescription_PortType)getService(SERVICE_DESCRIPTION, WSRP_v1_ServiceDescription_PortType.class);
+   }
+
+   WSRP_v1_Markup_PortType getMarkupService() throws InvokerUnavailableException
+   {
+      return (WSRP_v1_Markup_PortType)getService(MARKUP, WSRP_v1_Markup_PortType.class);
+   }
+
+   WSRP_v1_PortletManagement_PortType getPortletManagementService() throws InvokerUnavailableException
+   {
+      return (WSRP_v1_PortletManagement_PortType)getService(PORTLET_MANAGEMENT, WSRP_v1_PortletManagement_PortType.class);
+   }
+
+   WSRP_v1_Registration_PortType getRegistrationService() throws InvokerUnavailableException
+   {
+      return (WSRP_v1_Registration_PortType)getService(REGISTRATION, WSRP_v1_Registration_PortType.class);
+   }
+
+   private Object getService(String description, Class clazz) throws InvokerUnavailableException
+   {
+      try
+      {
+         return getServiceFactory().getService(clazz);
+      }
+      catch (Exception e)
+      {
+         throw new InvokerUnavailableException("Couldn't access " + description + " service. Cause: "
+            + e.getLocalizedMessage(), e);
+      }
+   }
 }

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -102,6 +102,7 @@
       // as long as we don't get a non-null response and we're allowed to try again, try to perform the request
       while (response == null && retryCount < MAXIMUM_RETRY_NUMBER)
       {
+         log.debug("performRequest: " + (retryCount + 1) + " attempt(s) out of " + MAXIMUM_RETRY_NUMBER + " possible");
          SessionHandler sessionHandler = consumer.getSessionHandler();
 
          // prepare everything for the request
@@ -187,6 +188,7 @@
       }
       else if (error instanceof InvalidRegistrationFault)
       {
+         log.debug("Invalid registration");
          consumer.handleInvalidRegistrationFault();
       }
       else if (error instanceof RemoteException)

Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -0,0 +1,509 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2007, 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.wsrp.consumer;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.portlet.InvokerUnavailableException;
+import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.consumer.portlet.WSRPPortlet;
+import org.jboss.portal.wsrp.consumer.portlet.info.WSRPPortletInfo;
+import org.jboss.portal.wsrp.core.CookieProtocol;
+import org.jboss.portal.wsrp.core.GetPortletDescription;
+import org.jboss.portal.wsrp.core.GetServiceDescription;
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+import org.jboss.portal.wsrp.core.PortletDescription;
+import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
+import org.jboss.portal.wsrp.core.RegistrationContext;
+import org.jboss.portal.wsrp.core.ServiceDescription;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class ProducerInfo
+{
+   private final Logger log = Logger.getLogger(getClass());
+   private EndpointConfigurationInfo endpointConfigurationInfo;
+   private RegistrationInfo registrationInfo;
+   private String producerId;
+   private CookieProtocol requiresInitCookie;
+   private boolean isInitialized;
+
+   /** The Producer-Offered Portlets (handle -> WSRPPortlet) */
+   private Map popsMap;
+
+   /** Portlet groups. */
+   private Map portletGroups;
+
+   /** The cache expiration duration (in seconds) for cached values */
+   private Integer expirationCacheSeconds;
+
+   /** . */
+   private long expirationTimeMillis;
+
+   /** The service description request sent to producer before registration happens. */
+   private final GetServiceDescription unregisteredServiceDescriptionRequest;
+
+   /** The service description sent to producer. */
+   private GetServiceDescription serviceDescriptionRequest;
+
+   /** The registration with the current producer. */
+   private RegistrationContext registrationContext;
+
+   /*protected org.jboss.portal.wsrp.core.ItemDescription[] userCategoryDescriptions;
+   protected org.jboss.portal.wsrp.core.ItemDescription[] customUserProfileItemDescriptions;
+   protected org.jboss.portal.wsrp.core.ItemDescription[] customWindowStateDescriptions;
+   protected org.jboss.portal.wsrp.core.ItemDescription[] customModeDescriptions;
+
+   protected org.jboss.portal.wsrp.core.ModelDescription registrationPropertyDescription;
+   protected java.lang.String[] locales;
+   protected org.jboss.portal.wsrp.core.ResourceList resourceList;*/
+
+
+   public ProducerInfo()
+   {
+      unregisteredServiceDescriptionRequest = initUnregisteredServiceDescriptionRequest();
+      endpointConfigurationInfo = new EndpointConfigurationInfo(this);
+      registrationInfo = RegistrationInfo.REGISTRATION_NOT_NEEDED;
+   }
+
+   public EndpointConfigurationInfo getEndpointConfigurationInfo()
+   {
+      return endpointConfigurationInfo;
+   }
+
+
+   void setEndpointConfigurationInfo(EndpointConfigurationInfo endpointConfigurationInfo)
+   {
+      this.endpointConfigurationInfo = endpointConfigurationInfo;
+   }
+
+   public RegistrationInfo getRegistrationInfo()
+   {
+      return registrationInfo;
+   }
+
+   void setRegistrationInfo(RegistrationInfo registrationInfo)
+   {
+      this.registrationInfo = registrationInfo;
+   }
+
+   public boolean requiresRegistration()
+   {
+      return registrationInfo != null && registrationInfo.requiresRegistration();
+   }
+
+   public CookieProtocol getRequiresInitCookie()
+   {
+      return requiresInitCookie;
+   }
+
+
+   public boolean isInitialized()
+   {
+      return isInitialized;
+   }
+
+   public boolean refreshIfNeeded() throws PortletInvokerException, ServiceDescriptionUnavailableException
+   {
+      ServiceDescription serviceDescription;
+      // might neeed a different cache value: right now, we cache the whole producer info but we might want to cache
+      // POPs and rest of producer info separetely...
+      if (isCacheExpired() || !isInitialized())
+      {
+         log.debug("ProducerInfo refresh needed for producer '" + producerId + "'");
+         serviceDescription = getServiceDescription();
+
+         // do we need to call initCookie or not?
+         requiresInitCookie = serviceDescription.getRequiresInitCookie();
+
+         if (serviceDescription.isRequiresRegistration())
+         {
+
+            if (registrationInfo == null)
+            {
+               registrationInfo = new RegistrationInfo(this);
+            }
+
+            // check if the configured registration information is correct and if we can get the service description
+            if (registrationInfo.initialize(serviceDescription, getId()))
+            {
+               try
+               {
+                  log.debug("Attempting registration");
+                  RegistrationContext registrationContext = endpointConfigurationInfo.getRegistrationService()
+                     .register(registrationInfo.getRegistrationData());
+
+                  if (registrationContext == null)
+                  {
+                     throw new PortletInvokerException("Received null response after registration from producer '" + producerId + "'");
+                  }
+
+                  //todo: hook to registration subsystem correctly Registration should deal with state and
+                  // it should be possible to create a RegistrationContext from a Registration
+                  registrationInfo.setRegistrationContext(registrationContext);
+                  log.info("Successfully registered with handle: '" + registrationContext.getRegistrationHandle() + "'");
+               }
+               catch (Exception e)
+               {
+                  registrationInfo.resetRegistration();
+                  throw new PortletInvokerException("Couldn't register with producer '" + producerId + "'", e);
+               }
+
+               log.debug("Requesting service description after registration");
+               extractOfferedPortlets(getServiceDescription());
+               isInitialized = true;
+            }
+            else
+            {
+               log.info("Consumer is not ready to be registered with producer because of missing or invalid registration information.");
+               isInitialized = false;
+            }
+         }
+
+         //todo: could extract more information here...
+
+         log.debug("Registration not required");
+         setRegistrationInfo(RegistrationInfo.REGISTRATION_NOT_NEEDED);
+         setServiceDescriptionRequest(getUnregisteredServiceDescriptionRequest());
+         extractOfferedPortlets(getServiceDescription());
+         isInitialized = true;
+      }
+
+      if (isInitialized)
+      {
+         resetCacheTimerIfNeeded();
+      }
+      else
+      {
+         log.warn("Producer is NOT initialized.");
+      }
+
+      return isInitialized;
+   }
+
+   public boolean needsRegistration()
+   {
+      return requiresRegistration() && !registrationInfo.isRegistrationValid();
+   }
+
+   public String getId()
+   {
+      return producerId;
+   }
+
+   public void setId(String id)
+   {
+      this.producerId = id;
+   }
+
+   /**
+    * Extracts a map of offered Portlet objects from ServiceDescription
+    *
+    * @param sd
+    * @return a Map (portlet handle -> Portlet) of the offered portlets.
+    */
+   private Map extractOfferedPortlets(ServiceDescription sd)
+   {
+      if (sd == null)
+      {
+         throw new IllegalArgumentException("Provided ServiceDescription can't be null");
+      }
+
+      PortletDescription[] portletDescriptions = sd.getOfferedPortlets();
+
+      if (portletDescriptions != null)
+      {
+         int length = portletDescriptions.length;
+         log.debug("Extracting " + length + " portlets.");
+         popsMap = new LinkedHashMap(length);
+         portletGroups = new HashMap();
+
+         for (int i = 0; i < length; i++)
+         {
+            PortletDescription portletDescription = portletDescriptions[i];
+            WSRPPortlet wsrpPortlet = createWSRPPortletFromPortletDescription(portletDescription);
+
+            if (wsrpPortlet != null)
+            {
+               popsMap.put(wsrpPortlet.getContext().getId(), wsrpPortlet);
+            }
+         }
+      }
+      else
+      {
+         popsMap = Collections.EMPTY_MAP;
+      }
+
+      return popsMap;
+   }
+
+   /**
+    * @param portletDescription
+    * @return
+    * @since 2.6
+    */
+   WSRPPortlet createWSRPPortletFromPortletDescription(PortletDescription portletDescription)
+   {
+      ParameterValidation.throwIllegalArgExceptionIfNull(portletDescription, "PortletDescription");
+      String portletHandle = portletDescription.getPortletHandle();
+      log.debug("Extracting info for '" + portletHandle + "' portlet");
+      WSRPPortletInfo info = new WSRPPortletInfo(portletDescription);
+      WSRPPortlet wsrpPortlet = null;
+      if (info.isUsesMethodGet())
+      {
+         log.warn("Portlet '" + portletHandle
+            + "' uses the GET method in forms. Since we don't handle this, this portlet will be excluded from " +
+            "the list of offered portlets for producer " + producerId);
+      }
+      else if (info.isHasUserSpecificState())
+      {
+         log.warn("Portlet '" + portletHandle
+            + "' will store persistent state for each user. To be handled properly, this would require " +
+            "supporting portlet cloning, which we don't currently do. This portlet will be excluded from the " +
+            "list of offered portlets for producer " + producerId);
+      }
+      else
+      {
+         wsrpPortlet = new WSRPPortlet(PortletContext.createPortletContext(portletHandle), info);
+
+         // add the portlet to the appropriate group if needed
+         String portletGroupId = portletDescription.getGroupID();
+         if (portletGroupId != null)
+         {
+            Set groupedPortlets = (Set)portletGroups.get(portletGroupId);
+            if (groupedPortlets == null)
+            {
+               groupedPortlets = new HashSet();
+               portletGroups.put(portletGroupId, groupedPortlets);
+            }
+            groupedPortlets.add(wsrpPortlet);
+         }
+      }
+      return wsrpPortlet;
+   }
+
+   public Portlet getPortlet(String portletId) throws PortletInvokerException
+   {
+      try
+      {
+         if (!refreshIfNeeded())
+         {
+            throw new PortletInvokerException("Couldn't initialize producer '" + producerId + "'");
+         }
+      }
+      catch (ServiceDescriptionUnavailableException e)
+      {
+         throw new PortletInvokerException("Couldn't initialize producer '" + producerId + "'", e);
+      }
+
+      // if cache is still valid, use information from cached service description
+      if (useCache() && !isCacheExpired())
+      {
+         log.debug("getPortlet from cached service description");
+
+         return (Portlet)popsMap.get(portletId);
+      }
+      else // otherwise, retrieve just the information for the appropriate portlet
+      {
+         log.debug("getPortlet via getPortletDescription");
+
+         GetPortletDescription gpd = WSRPTypeFactory.createGetPortletDescription(registrationContext, portletId);
+         gpd.setUserContext(null); // todo: deal with user context!!
+         try
+         {
+            PortletDescriptionResponse response = endpointConfigurationInfo.getPortletManagementService().getPortletDescription(gpd);
+            ParameterValidation.throwIllegalArgExceptionIfNull(response, "PortletDescriptionResponse");
+            return createWSRPPortletFromPortletDescription(response.getPortletDescription());
+         }
+         catch (InvalidHandleFault invalidHandleFault)
+         {
+            throw new NoSuchPortletException(invalidHandleFault, portletId);
+         }
+         catch (Exception e)
+         {
+            throw new InvokerUnavailableException("Couldn't access remote producer '" + producerId + "'", e);
+         }
+      }
+   }
+
+   public Map getPortletGroupMap() throws ServiceDescriptionUnavailableException, PortletInvokerException
+   {
+      refreshPOPsIfNeeded();
+
+      return portletGroups;
+   }
+
+   public Map getPortletMap() throws ServiceDescriptionUnavailableException, PortletInvokerException
+   {
+      refreshPOPsIfNeeded();
+      return popsMap;
+   }
+
+   // Cache support ****************************************************************************************************
+
+   private boolean useCache()
+   {
+      return expirationCacheSeconds != null && expirationCacheSeconds.intValue() > 0;
+   }
+
+   private void refreshPOPsIfNeeded() throws ServiceDescriptionUnavailableException, PortletInvokerException
+   {
+      refreshIfNeeded();
+      if (isCacheExpired())
+      {
+         extractOfferedPortlets(getServiceDescription());
+
+         resetCacheTimerIfNeeded();
+      }
+   }
+
+   private void resetCacheTimerIfNeeded()
+   {
+      if (useCache())
+      {
+         // reset expiration time
+         expirationTimeMillis = System.currentTimeMillis() + (expirationCacheSeconds.intValue() * 1000);
+      }
+   }
+
+   /**
+    * @return
+    * @since 2.6
+    */
+   private boolean isCacheExpired()
+   {
+      return !useCache() || System.currentTimeMillis() > expirationTimeMillis || popsMap == null || portletGroups == null;
+   }
+
+   public Integer getExpirationCacheSeconds()
+   {
+      return expirationCacheSeconds;
+   }
+
+   public void setExpirationCacheSeconds(Integer expirationCacheSeconds)
+   {
+      this.expirationCacheSeconds = expirationCacheSeconds;
+   }
+
+   private ServiceDescription getServiceDescription() throws ServiceDescriptionUnavailableException, PortletInvokerException
+   {
+      GetServiceDescription request = getServiceDescriptionRequest();
+      request.setRegistrationContext(registrationContext);
+
+
+      ServiceDescription serviceDescription;
+      try
+      {
+         serviceDescription = endpointConfigurationInfo.getServiceDescriptionService().getServiceDescription(request);
+
+         if (serviceDescription != null)
+         {
+            // from now on (that is until getServiceDescription fails) use this successful request
+            setServiceDescriptionRequest(request);
+            return serviceDescription;
+         }
+         else
+         {
+            // fix-me: do something better
+            throw new NullPointerException("null service description: deal with it!");
+         }
+      }
+      catch (Exception e)
+      {
+         log.debug("Caught Exception in getServiceDescription:\n", e);
+         Throwable cause = e.getCause();
+         throw new ServiceDescriptionUnavailableException("Problem getting service description for producer "
+            + producerId, cause == null ? e : cause);
+      }
+   }
+
+   /**
+    * @return
+    * @throws PortletInvokerException
+    * @since 2.6
+    */
+   private ServiceDescription getMinimalServiceDescription() throws PortletInvokerException
+   {
+      ServiceDescription serviceDescription;
+      try
+      {
+         serviceDescription = endpointConfigurationInfo.getServiceDescriptionService().getServiceDescription(getUnregisteredServiceDescriptionRequest());
+      }
+      catch (Exception e)
+      {
+         throw new PortletInvokerException("Couldn't access service description for producer '"
+            + producerId + "'", e);
+      }
+      return serviceDescription;
+   }
+
+   private void setServiceDescriptionRequest(GetServiceDescription request)
+   {
+      serviceDescriptionRequest = request;
+   }
+
+   private GetServiceDescription getServiceDescriptionRequest()
+   {
+      return (serviceDescriptionRequest != null) ? serviceDescriptionRequest : getUnregisteredServiceDescriptionRequest();
+   }
+
+   /**
+    * Retrieves the service description request this consumer uses when not registered.
+    *
+    * @return the service description request this consumer uses when not registered.
+    */
+   private GetServiceDescription getUnregisteredServiceDescriptionRequest()
+   {
+      return unregisteredServiceDescriptionRequest;
+   }
+
+   /**
+    * Initializes the service description request this consumer uses when not registered. TODO: Implement
+    * customization.
+    *
+    * @return the service description request this consumer uses when not registered.
+    */
+   private GetServiceDescription initUnregisteredServiceDescriptionRequest()
+   {
+      GetServiceDescription gsd = WSRPTypeFactory.createGetServiceDescription();
+
+      gsd.setDesiredLocales(WSRPConstants.DEFAULT_LOCALES);
+      return gsd;
+   }
+}


Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -23,15 +23,27 @@
 
 package org.jboss.portal.wsrp.consumer;
 
+import org.jboss.logging.Logger;
 import org.jboss.portal.common.util.ParameterValidation;
 import org.jboss.portal.common.value.StringValue;
 import org.jboss.portal.registration.Registration;
+import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.WSRPUtils;
+import org.jboss.portal.wsrp.core.ModelDescription;
 import org.jboss.portal.wsrp.core.Property;
+import org.jboss.portal.wsrp.core.PropertyDescription;
+import org.jboss.portal.wsrp.core.RegistrationContext;
 import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.core.ServiceDescription;
 import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -42,31 +54,29 @@
  */
 public class RegistrationInfo
 {
+   public final static RegistrationInfo REGISTRATION_NOT_NEEDED = new RegistrationInfo();
+   private final Logger log = Logger.getLogger(getClass());
    private Registration registration;
    private boolean requiresRegistration;
    private Map registrationProperties;
    private RegistrationData registrationData;
+   private boolean isRegistrationValid;
+   private RegistrationContext registrationContext; // todo: remove
+   private String consumerName;
 
-   public RegistrationInfo(RegistrationData registrationData)
+   public RegistrationInfo(ProducerInfo producerInfo)
    {
-      ParameterValidation.throwIllegalArgExceptionIfNull(registrationData, "RegistrationData");
-      this.registrationData = registrationData;
-      Property[] props = registrationData.getRegistrationProperties();
-      ParameterValidation.throwIllegalArgExceptionIfNull(props, "Registration properties");
-      requiresRegistration = true;
-      int propNumber = props.length;
+      ParameterValidation.throwIllegalArgExceptionIfNull(producerInfo, "ProducerInfo");
+      producerInfo.setRegistrationInfo(this);
+      consumerName = WSRPConstants.DEFAULT_CONSUMER_NAME;
+   }
 
-      if (propNumber > 0)
-      {
-         registrationProperties = new HashMap(propNumber);
-      }
 
-      for (int i = 0; i < propNumber; i++)
-      {
-         Property prop = props[i];
-         String name = prop.getName();
-         registrationProperties.put(name, new RegistrationProperty(name, prop.getStringValue()));
-      }
+   private RegistrationInfo()
+   {
+      consumerName = WSRPConstants.DEFAULT_CONSUMER_NAME;
+      isRegistrationValid = true;
+      requiresRegistration = false;
    }
 
    public boolean requiresRegistration()
@@ -81,17 +91,44 @@
 
    public RegistrationData getRegistrationData()
    {
+      if (registrationData == null)
+      {
+         registrationData = WSRPTypeFactory.createDefaultRegistrationData();
+         registrationData.setConsumerName(consumerName);
+         List properties = new ArrayList();
+         Map regProps = getRegistrationProperties();
+         if (!regProps.isEmpty())
+         {
+            for (Iterator entries = regProps.values().iterator(); entries.hasNext();)
+            {
+               RegistrationProperty prop = (RegistrationProperty)entries.next();
+               String value = prop.getValueAsString();
+               if (value != null && !prop.isInvalid())
+               {
+                  properties.add(WSRPTypeFactory.createProperty(prop.getName(), prop.getLang(), prop.getValueAsString()));
+               }
+            }
+
+            registrationData.setRegistrationProperties((Property[])properties.toArray(new Property[0]));
+         }
+      }
+
       return registrationData;
    }
 
    public String getConsumerName()
    {
-      return registrationData.getConsumerName();
+      return consumerName;
    }
 
+   public void setConsumerName(String consumerName)
+   {
+      this.consumerName = consumerName;
+   }
+
    public String getConsumerAgent()
    {
-      return registrationData.getConsumerAgent();
+      return WSRPConstants.CONSUMER_AGENT;
    }
 
    public RegistrationProperty getRegistrationProperty(String name)
@@ -100,11 +137,50 @@
       return (RegistrationProperty)getRegistrationProperties().get(name);
    }
 
+   public RegistrationProperty setRegistrationPropertyValue(String name, String value)
+   {
+      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "registration property name", "RegistrationInfo.setRegistrationPropertyValue");
+      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(value, "registration property value", "RegistrationInfo.setRegistrationPropertyValue");
+
+      RegistrationProperty prop = (RegistrationProperty)getOrCreateRegistrationPropertiesMap(true).get(name);
+      if (prop != null)
+      {
+         prop.setValue(value);
+      }
+      else
+      {
+         prop = new RegistrationProperty(name, value);
+         getOrCreateRegistrationPropertiesMap(false).put(name, prop);
+      }
+
+      return prop;
+   }
+
+   public void removeRegistrationProperty(String name)
+   {
+      ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "registration property name", "RegistrationInfo.removeRegistrationProperty");
+      if (registrationProperties == null || getOrCreateRegistrationPropertiesMap(false).remove(name) == null)
+      {
+         throw new IllegalArgumentException("Cannot remove inexistent registration property '" + name + "'");
+      }
+   }
+
+   private Map getOrCreateRegistrationPropertiesMap(boolean forceCreate)
+   {
+      if (forceCreate && registrationProperties == null)
+      {
+         registrationProperties = new HashMap();
+      }
+
+      return registrationProperties;
+   }
+
    public Map getRegistrationProperties()
    {
-      if (registrationProperties != null)
+      Map properties = getOrCreateRegistrationPropertiesMap(false);
+      if (properties != null)
       {
-         return Collections.unmodifiableMap(registrationProperties);
+         return Collections.unmodifiableMap(properties);
       }
       else
       {
@@ -117,9 +193,161 @@
       return getRegistrationProperties().keySet();
    }
 
+   /**
+    * @param serviceDescription
+    * @param producerId
+    * @return <code>true</code> if the associated producer is ready to be interacted with as far as registration is
+    *         concerned, <code>false</code> otherwise.
+    * @since 2.6
+    */
+   boolean initialize(ServiceDescription serviceDescription, String producerId)
+   {
+      log.debug("RegistrationInfo initialization requested");
+      boolean configurationValid;
+      if (serviceDescription.isRequiresRegistration() && !isRegistrationValid())
+      {
+         requiresRegistration = true;
+         StringBuffer message = new StringBuffer("Producer '").append(producerId).append("' requires registration.");
+         log.info(message);
+
+         // check if the configured registration properties match the producer expectations
+         ModelDescription regPropDescs = serviceDescription.getRegistrationPropertyDescription();
+         if (regPropDescs != null)
+         {
+            configurationValid = true;
+            PropertyDescription[] propertyDescriptions = regPropDescs.getPropertyDescriptions();
+            Map descriptionsMap = getRegistrationPropertyDescriptionsFromWSRP(propertyDescriptions);
+
+            Map registrationProperties = getOrCreateRegistrationPropertiesMap(true);
+
+            // check that we don't have unexpected registration properties and if so, mark them as invalid
+            Set unexpected = new HashSet(registrationProperties.keySet());
+            Set expectedNames = descriptionsMap.keySet();
+            unexpected.removeAll(expectedNames);
+            if (!unexpected.isEmpty())
+            {
+               message = new StringBuffer("The registration for producer '"
+                  + producerId + "' provided values for unexpected registration properties: ");
+               for (Iterator invalidProps = unexpected.iterator(); invalidProps.hasNext();)
+               {
+                  String name = (String)invalidProps.next();
+                  message.append("\t- ").append(name).append("\n");
+                  ((RegistrationProperty)registrationProperties.get(name)).setInvalid(true);
+               }
+               log.info(message);
+               resetRegistration();
+               configurationValid = false;
+            }
+
+            // now check for missing properties, add the missing ones with a null value
+            StringBuffer missingProps = new StringBuffer();
+            for (Iterator descriptionNames = expectedNames.iterator(); descriptionNames.hasNext();)
+            {
+               String name = (String)descriptionNames.next();
+               RegistrationProperty prop = (RegistrationProperty)registrationProperties.get(name);
+               if (prop == null)
+               {
+                  Object missingProp = descriptionsMap.get(name);
+                  registrationProperties.put(name, missingProp);
+                  missingProps.append("Missing value for ").append(missingProp).append("\n");
+               }
+            }
+
+            if (missingProps.length() > 0)
+            {
+               log.info(missingProps);
+               resetRegistration();
+               configurationValid = false;
+            }
+         }
+         else
+         {
+            log.info("The producer didn't require any specific registration properties.");
+            if (!getRegistrationProperties().isEmpty())
+            {
+               resetRegistration();
+               log.info("Registration data is available for producer '"
+                  + producerId + "' when none is expected by the producer.");
+               configurationValid = false;
+            }
+            else
+            {
+               log.info("Using default registration data for producer '" + producerId + "'");
+               registrationData = WSRPTypeFactory.createDefaultRegistrationData();
+               configurationValid = true;
+            }
+         }
+      }
+      else
+      {
+         log.info("Producer '" + producerId + "' doesn't require registration.");
+         requiresRegistration = false;
+         configurationValid = true;
+      }
+
+      log.debug("Registration configuration is " + (configurationValid ? "" : "NOT") + " valid");
+      return configurationValid;
+   }
+
+   /**
+    * @param descriptions
+    * @return
+    * @since 2.6
+    */
+   private Map getRegistrationPropertyDescriptionsFromWSRP(PropertyDescription[] descriptions)
+   {
+      if (descriptions != null)
+      {
+         Map result = new HashMap(descriptions.length);
+         for (int i = 0; i < descriptions.length; i++)
+         {
+            PropertyDescription description = descriptions[i];
+            String name = description.getName();
+            RegistrationProperty prop = new RegistrationProperty(name, null);
+            RegistrationPropertyDescription desc = WSRPUtils.convertToRegistrationPropertyDescription(description);
+            prop.setDescription(desc);
+            result.put(name, prop);
+         }
+
+         return result;
+      }
+      else
+      {
+         return Collections.EMPTY_MAP;
+      }
+   }
+
+   /** @since 2.6 */
+   void resetRegistration()
+   {
+      registrationData = null;
+      registrationContext = null;
+      isRegistrationValid = false;
+   }
+
+   public boolean isRegistrationValid()
+   {
+//      return !requiresRegistration() || (registration != null && RegistrationStatus.VALID == registration.getStatus());
+      return isRegistrationValid;
+   }
+
+   public void setRegistrationContext(RegistrationContext registrationContext)
+   {
+      // todo: remove
+      this.registrationContext = registrationContext;
+      isRegistrationValid = true;
+   }
+
+   public RegistrationContext getRegistrationContext()
+   {
+      return registrationContext;
+   }
+
    public static class RegistrationProperty extends org.jboss.portal.portlet.state.Property
    {
       private RegistrationPropertyDescription description;
+      private boolean isInvalid;
+      private String lang;
 
       public RegistrationProperty(String name, String stringValue)
       {
@@ -140,5 +368,30 @@
       {
          this.description = description;
       }
+
+      public boolean isInvalid()
+      {
+         return isInvalid;
+      }
+
+      public void setInvalid(boolean invalid)
+      {
+         isInvalid = invalid;
+      }
+
+      public void setValue(String stringValue)
+      {
+         value = new StringValue(stringValue);
+      }
+
+      public String getLang()
+      {
+         return lang;
+      }
+
+      public void setLang(String lang)
+      {
+         this.lang = lang;
+      }
    }
 }

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -81,6 +81,7 @@
    protected Object prepareRequest(RequestPrecursor requestPrecursor, PortletInvocation invocation)
    {
       // Create the markup request
+      log.debug("Consumer about to attempt rendering portlet '" + requestPrecursor.portletHandle + "'");
       return WSRPTypeFactory.createMarkupRequest(requestPrecursor.portletHandle,
          requestPrecursor.runtimeContext, requestPrecursor.markupParams);
    }

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RequestPrecursor.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -26,6 +26,7 @@
 import org.jboss.logging.Logger;
 import org.jboss.portal.common.util.ParameterValidation;
 import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.PortletInvokerException;
 import org.jboss.portal.portlet.StateString;
 import org.jboss.portal.portlet.invocation.PortletInvocation;
 import org.jboss.portal.portlet.spi.PortletInvocationContext;
@@ -58,7 +59,7 @@
    private static final String STREAM_INFO = "stream info in invocation context";
    private static final String USER_AGENT = "User-Agent";
 
-   public RequestPrecursor(WSRPConsumerImpl wsrpConsumer, PortletInvocation invocation)
+   public RequestPrecursor(WSRPConsumerImpl wsrpConsumer, PortletInvocation invocation) throws PortletInvokerException
    {
       // retrieve handle
       portletHandle = WSRPConsumerImpl.getPortletHandle(invocation);

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -26,6 +26,7 @@
 import org.jboss.logging.Logger;
 import org.jboss.portal.common.util.ParameterValidation;
 import org.jboss.portal.portlet.InvokerUnavailableException;
+import org.jboss.portal.portlet.PortletInvokerException;
 import org.jboss.portal.portlet.invocation.PortletInvocation;
 import org.jboss.portal.wsrp.WSRPTypeFactory;
 import org.jboss.portal.wsrp.consumer.portlet.info.WSRPPortletInfo;
@@ -83,7 +84,7 @@
       this.requiresInitCookie = requiresInitCookie;
    }
 
-   void initProducerSessionInformation(PortletInvocation invocation)
+   void initProducerSessionInformation(PortletInvocation invocation) throws PortletInvokerException
    {
       // if we need cookies, set the current group id
       String groupId = null;
@@ -144,19 +145,24 @@
 
       if (isPerUserCookieInit())
       {
+         log.debug("Cookie initialization per user requested.");
          sessionInformation.setPerGroupCookies(false);
          initCookie(initCookie, invocation, retryIfFails);
       }
       else
       {
+         log.debug("Cookie initialization per group requested.");
          sessionInformation.setPerGroupCookies(true);
          Map groups = consumer.getPortletGroupMap();
 
          try
          {
+            String groupId;
             for (Iterator groupIds = groups.keySet().iterator(); groupIds.hasNext();)
             {
-               RequestHeaderClientHandler.setCurrentGroupId((String)groupIds.next());
+               groupId = (String)groupIds.next();
+               RequestHeaderClientHandler.setCurrentGroupId(groupId);
+               log.debug("Initializing cookie for group '" + groupId + "'.");
                initCookie(initCookie, invocation, retryIfFails);
             }
          }

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -53,22 +53,13 @@
 import org.jboss.portal.wsrp.core.DestroyFailed;
 import org.jboss.portal.wsrp.core.DestroyPortlets;
 import org.jboss.portal.wsrp.core.DestroyPortletsResponse;
-import org.jboss.portal.wsrp.core.GetPortletDescription;
 import org.jboss.portal.wsrp.core.GetPortletProperties;
-import org.jboss.portal.wsrp.core.GetServiceDescription;
-import org.jboss.portal.wsrp.core.InvalidHandleFault;
-import org.jboss.portal.wsrp.core.LocalizedString;
-import org.jboss.portal.wsrp.core.ModelDescription;
-import org.jboss.portal.wsrp.core.PortletDescription;
-import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
 import org.jboss.portal.wsrp.core.Property;
-import org.jboss.portal.wsrp.core.PropertyDescription;
 import org.jboss.portal.wsrp.core.PropertyList;
 import org.jboss.portal.wsrp.core.RegistrationContext;
 import org.jboss.portal.wsrp.core.RegistrationData;
 import org.jboss.portal.wsrp.core.ResetProperty;
 import org.jboss.portal.wsrp.core.RuntimeContext;
-import org.jboss.portal.wsrp.core.ServiceDescription;
 import org.jboss.portal.wsrp.core.SetPortletProperties;
 import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
 import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
@@ -83,7 +74,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Locale;
@@ -98,54 +88,15 @@
  */
 public class WSRPConsumerImpl extends AbstractJBossService implements WSRPConsumer
 {
-   private static final String SERVICE_DESCRIPTION = "service description";
-   private static final String MARKUP = "markup";
-   private static final String PORTLET_MANAGEMENT = "portlet management";
-   private static final String REGISTRATION = "registration";
-
    private ActionHandler actionHandler;
    private RenderHandler renderHandler;
    private SessionHandler sessionHandler;
 
-   /** The service description request sent to producer before registration happens. */
-   private final GetServiceDescription unregisteredServiceDescriptionRequest;
-
-   /** The service description sent to producer. */
-   private GetServiceDescription serviceDescriptionRequest;
-
-   /** The registration with the current producer. */
-   private RegistrationContext registrationContext;
-
-   /** The service factory. */
-   private ServiceFactory serviceFactory;
-
-   /** The Producer-Offered Portlets (handle -> WSRPPortlet) */
-   private Map popsMap;
-
    /** Consumer-Configured Portlets (handle -> WSRPPortlet) */
    private Map ccpsMap = new HashMap();
 
-   /** Portlet groups. */
-   private Map portletGroups;
+   private ProducerInfo producerInfo;
 
-   /** The cache expiration duration (in seconds) for cached values */
-   private Integer expirationCacheSeconds;
-
-   /** . */
-   private long expirationTimeMillis;
-
-   /** The identifier of the associated producer */
-   private String producerId;
-
-   /** The registration information for this consumer */
-   private RegistrationInfo registrationInfo;
-
-   /** The configuration information for the WSRP endpoints of the associated producer. */
-   private EndpointConfigurationInfo endpointConfigurationInfo;
-
-   /** The registration data used to register this consumer with the associated producer */
-   private RegistrationData registrationData;
-
    /** A registration data element used to indicate when no registration was required by the producer */
    private final static RegistrationData REGISTRATION_NOT_NEEDED = WSRPTypeFactory.createDefaultRegistrationData();
 
@@ -170,17 +121,22 @@
 
    public WSRPConsumerImpl()
    {
-      unregisteredServiceDescriptionRequest = initUnregisteredServiceDescriptionRequest();
+      producerInfo = new ProducerInfo();
       actionHandler = new ActionHandler(this);
       renderHandler = new RenderHandler(this);
       sessionHandler = new SessionHandler(this);
    }
 
-   public EndpointConfigurationInfo getEndpointConfigurationInfo()
+   public ProducerInfo getProducerInfo()
    {
-      return endpointConfigurationInfo;
+      return producerInfo;
    }
 
+   public void setProducerInfo(ProducerInfo producerInfo)
+   {
+      this.producerInfo = producerInfo;
+   }
+
    // PortletInvoker implementation ************************************************************************************
 
    public Set getPortlets() throws InvokerUnavailableException
@@ -211,34 +167,8 @@
       // the portlet is not cloned, so try POP ones...
       if (portlet == null)
       {
-         // if cache is still valid, use information from cached service description
-         if (useCache() && !isCacheExpired())
-         {
-            log.debug("getPortlet from cached service description");
-
-            portlet = (Portlet)popsMap.get(portletId);
-         }
-         else // otherwise, retrieve just the information for the appropriate portlet
-         {
-            log.debug("getPortlet via getPortletDescription");
-            initializeProducerInteractionAndRegisterIfPossible();
-            GetPortletDescription gpd = WSRPTypeFactory.createGetPortletDescription(registrationContext, portletId);
-            gpd.setUserContext(null); // todo: deal with user context!!
-            try
-            {
-               PortletDescriptionResponse response = getPortletManagementService().getPortletDescription(gpd);
-               ParameterValidation.throwIllegalArgExceptionIfNull(response, "PortletDescriptionResponse");
-               portlet = createWSRPPortletFromPortletDescription(response.getPortletDescription());
-            }
-            catch (InvalidHandleFault invalidHandleFault)
-            {
-               throw new NoSuchPortletException(invalidHandleFault, portletId);
-            }
-            catch (Exception e)
-            {
-               throw new InvokerUnavailableException("Couldn't access remote producer '" + producerId + "'", e);
-            }
-         }
+         refreshProducerInfo();
+         portlet = producerInfo.getPortlet(portletId);
       }
 
       if (portlet == null)
@@ -254,7 +184,7 @@
    public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
    {
       InvocationHandler handler;
-      initializeProducerInteractionAndRegisterIfPossible();
+      refreshProducerInfo();
 
       if (invocation instanceof RenderInvocation)
       {
@@ -282,10 +212,10 @@
          throw new PortletInvokerException("No portlet '" + portletContext.getId() + "' to clone!");
       }
 
-      initializeProducerInteractionAndRegisterIfPossible();
+      refreshProducerInfo();
 
       // todo: deal with user context
-      ClonePortlet clonePortlet = WSRPTypeFactory.createClonePortlet(registrationContext,
+      ClonePortlet clonePortlet = WSRPTypeFactory.createClonePortlet(getRegistrationContext(),
          WSRPUtils.convertToWSRPPortletContext(portletContext), null);
       try
       {
@@ -326,9 +256,9 @@
          handles.add(id);
       }
 
-      initializeProducerInteractionAndRegisterIfPossible();
+      refreshProducerInfo();
 
-      DestroyPortlets destroyPortlets = WSRPTypeFactory.createDestroyPortlets(registrationContext,
+      DestroyPortlets destroyPortlets = WSRPTypeFactory.createDestroyPortlets(getRegistrationContext(),
          (String[])handles.toArray(new String[0]));
 
       try
@@ -377,9 +307,10 @@
    {
       ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
 
-      initializeProducerInteractionAndRegisterIfPossible();
+      refreshProducerInfo();
 
-      GetPortletProperties getPortletProperties = WSRPTypeFactory.createGetPortletProperties(registrationContext, portletContext.getId());
+      GetPortletProperties getPortletProperties = WSRPTypeFactory.createGetPortletProperties(getRegistrationContext(),
+         portletContext.getId());
       getPortletProperties.setNames(keys);
 
       try
@@ -431,7 +362,7 @@
             + "' because there is no such portlet.");
       }
 
-      initializeProducerInteractionAndRegisterIfPossible();
+      refreshProducerInfo();
 
       PropertyList propertyList = WSRPTypeFactory.createPropertyList();
       int changesNumber = changes.length;
@@ -481,14 +412,9 @@
 
    // Accessors ********************************************************************************************************
 
-   public void setProducerId(String id)
-   {
-      this.producerId = id;
-   }
-
    public String getProducerId()
    {
-      return producerId;
+      return producerInfo.getId();
    }
 
    public SessionHandler getSessionHandler()
@@ -500,9 +426,7 @@
 
    public Map getPortletGroupMap() throws ServiceDescriptionUnavailableException, PortletInvokerException
    {
-      refreshPOPsIfNeeded();
-
-      return portletGroups;
+      return producerInfo.getPortletGroupMap();
    }
 
    static String getPortletHandle(PortletInvocation invocation)
@@ -510,17 +434,9 @@
       return ((PortletContext)invocation.getAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE)).getId();
    }
 
-   WSRPPortletInfo getPortletInfo(PortletInvocation invocation)
+   WSRPPortletInfo getPortletInfo(PortletInvocation invocation) throws PortletInvokerException
    {
-      try
-      {
-         return (WSRPPortletInfo)getWSRPPortlet(getPortletHandle(invocation)).getInfo();
-      }
-      catch (PortletInvokerException e)
-      {
-         log.debug("Couldn't retrieve portlet info for portlet: '" + getPortletHandle(invocation) + "'", e);
-         return null;
-      }
+      return (WSRPPortletInfo)getWSRPPortlet(getPortletHandle(invocation)).getInfo();
    }
 
    WSRPPortlet getWSRPPortlet(String portletId) throws PortletInvokerException
@@ -530,150 +446,19 @@
 
    private Map getPortletMap() throws ServiceDescriptionUnavailableException, PortletInvokerException
    {
-      refreshPOPsIfNeeded();
-
+      refreshProducerInfo();
       if (ccpsMap.isEmpty())
       {
-         return popsMap;
+         return producerInfo.getPortletMap();
       }
       else
       {
-         Map all = new HashMap(popsMap);
+         Map all = new HashMap(producerInfo.getPortletMap());
          all.putAll(ccpsMap);
          return all;
       }
    }
 
-   /**
-    * Extracts a map of offered Portlet objects from ServiceDescription
-    *
-    * @param sd
-    * @return a Map (portlet handle -> Portlet) of the offered portlets.
-    */
-   private Map extractOfferedPortlets(ServiceDescription sd)
-   {
-      if (sd == null)
-      {
-         throw new IllegalArgumentException("Provided ServiceDescription can't be null");
-      }
-
-      PortletDescription[] portletDescriptions = sd.getOfferedPortlets();
-
-      if (portletDescriptions != null)
-      {
-         int length = portletDescriptions.length;
-         log.debug("Extracting " + length + " portlets.");
-         popsMap = new LinkedHashMap(length);
-         portletGroups = new HashMap();
-
-         for (int i = 0; i < length; i++)
-         {
-            PortletDescription portletDescription = portletDescriptions[i];
-            WSRPPortlet wsrpPortlet = createWSRPPortletFromPortletDescription(portletDescription);
-
-            if (wsrpPortlet != null)
-            {
-               popsMap.put(wsrpPortlet.getContext().getId(), wsrpPortlet);
-            }
-         }
-      }
-      else
-      {
-         popsMap = Collections.EMPTY_MAP;
-      }
-
-      return popsMap;
-   }
-
-   /**
-    * @param portletDescription
-    * @return
-    * @since 2.6
-    */
-   private WSRPPortlet createWSRPPortletFromPortletDescription(PortletDescription portletDescription)
-   {
-      ParameterValidation.throwIllegalArgExceptionIfNull(portletDescription, "PortletDescription");
-      String portletHandle = portletDescription.getPortletHandle();
-      log.debug("Extracting info for '" + portletHandle + "' portlet");
-      WSRPPortletInfo info = new WSRPPortletInfo(portletDescription);
-      WSRPPortlet wsrpPortlet = null;
-      if (info.isUsesMethodGet())
-      {
-         log.warn("Portlet '" + portletHandle
-            + "' uses the GET method in forms. Since we don't handle this, this portlet will be excluded from " +
-            "the list of offered portlets for producer " + getProducerId());
-      }
-      else if (info.isHasUserSpecificState())
-      {
-         log.warn("Portlet '" + portletHandle
-            + "' will store persistent state for each user. To be handled properly, this would require " +
-            "supporting portlet cloning, which we don't currently do. This portlet will be excluded from the " +
-            "list of offered portlets for producer " + getProducerId());
-      }
-      else
-      {
-         wsrpPortlet = new WSRPPortlet(PortletContext.createPortletContext(portletHandle), info);
-
-         // add the portlet to the appropriate group if needed
-         String portletGroupId = portletDescription.getGroupID();
-         if (portletGroupId != null)
-         {
-            Set groupedPortlets = (Set)portletGroups.get(portletGroupId);
-            if (groupedPortlets == null)
-            {
-               groupedPortlets = new HashSet();
-               portletGroups.put(portletGroupId, groupedPortlets);
-            }
-            groupedPortlets.add(wsrpPortlet);
-         }
-      }
-      return wsrpPortlet;
-   }
-
-   // Cache support ****************************************************************************************************
-
-   private boolean useCache()
-   {
-      return expirationCacheSeconds != null && expirationCacheSeconds.intValue() > 0;
-   }
-
-   private void refreshPOPsIfNeeded() throws ServiceDescriptionUnavailableException, PortletInvokerException
-   {
-      if (useCache())
-      {
-         if (isCacheExpired())
-         {
-            extractOfferedPortlets(getServiceDescriptionAndRegisterIfNeeded());
-
-            // reset expiration time
-            expirationTimeMillis = System.currentTimeMillis() + (expirationCacheSeconds.intValue() * 1000);
-         }
-      }
-      else
-      {
-         extractOfferedPortlets(getServiceDescriptionAndRegisterIfNeeded());
-      }
-   }
-
-   /**
-    * @return
-    * @since 2.6
-    */
-   private boolean isCacheExpired()
-   {
-      return System.currentTimeMillis() > expirationTimeMillis || popsMap == null || portletGroups == null;
-   }
-
-   public Integer getExpirationCacheSeconds()
-   {
-      return expirationCacheSeconds;
-   }
-
-   public void setExpirationCacheSeconds(Integer expirationCacheSeconds)
-   {
-      this.expirationCacheSeconds = expirationCacheSeconds;
-   }
-
    public Set getSupportedUserScopes()
    {
       return Collections.unmodifiableSet(supportedUserScopes);
@@ -694,35 +479,16 @@
 
    void handleInvalidRegistrationFault() throws ServiceDescriptionUnavailableException, PortletInvokerException
    {
-      log.debug("Trying to re-register after InvalidRegistrationFault");
-
       // reset registration data and try again
-      resetRegistration();
-      initializeProducerInteractionAndRegisterIfPossible();
+      producerInfo.getRegistrationInfo().resetRegistration();
+      refreshProducerInfo();
    }
 
    RegistrationContext getRegistrationContext()
    {
-      return registrationContext;
+      return producerInfo.getRegistrationInfo().getRegistrationContext();
    }
 
-   public void setRegistrationData(RegistrationData registrationData)
-   {
-      ParameterValidation.throwIllegalArgExceptionIfNull(registrationData, "RegistrationData");
-      this.registrationData = registrationData;
-      this.registrationInfo = new RegistrationInfo(registrationData);
-   }
-
-   public RegistrationData getRegistrationData()
-   {
-      return registrationData;
-   }
-
-   public RegistrationInfo getRegistrationInfo()
-   {
-      return registrationInfo;
-   }
-
    // Session information access ***************************************************************************************
 
    public ProducerSessionInformation getProducerSessionInformationFrom(PortletInvocation invocation)
@@ -739,321 +505,61 @@
 
    protected void startService() throws Exception
    {
-      serviceFactory.start();
-      endpointConfigurationInfo = new EndpointConfigurationInfo(this);
+      getServiceFactory().start();
    }
 
    // Web services access **********************************************************************************************
 
    public ServiceFactory getServiceFactory()
    {
-      return serviceFactory;
+      return producerInfo.getEndpointConfigurationInfo().getServiceFactory();
    }
 
    public void setServiceFactory(ServiceFactory serviceFactory)
    {
-      this.serviceFactory = serviceFactory;
+      producerInfo.getEndpointConfigurationInfo().setServiceFactory(serviceFactory);
    }
 
    public WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws InvokerUnavailableException
    {
-      return (WSRP_v1_ServiceDescription_PortType)getService(SERVICE_DESCRIPTION,
-         WSRP_v1_ServiceDescription_PortType.class);
+      return producerInfo.getEndpointConfigurationInfo().getServiceDescriptionService();
    }
 
    public WSRP_v1_Markup_PortType getMarkupService() throws InvokerUnavailableException
    {
-      return (WSRP_v1_Markup_PortType)getService(MARKUP, WSRP_v1_Markup_PortType.class);
+      return producerInfo.getEndpointConfigurationInfo().getMarkupService();
    }
 
    public WSRP_v1_PortletManagement_PortType getPortletManagementService() throws InvokerUnavailableException
    {
-      return (WSRP_v1_PortletManagement_PortType)getService(PORTLET_MANAGEMENT,
-         WSRP_v1_PortletManagement_PortType.class);
+      return producerInfo.getEndpointConfigurationInfo().getPortletManagementService();
    }
 
    public WSRP_v1_Registration_PortType getRegistrationService() throws InvokerUnavailableException
    {
-      return (WSRP_v1_Registration_PortType)getService(REGISTRATION, WSRP_v1_Registration_PortType.class);
+      return producerInfo.getEndpointConfigurationInfo().getRegistrationService();
    }
 
-   private Object getService(String description, Class clazz) throws InvokerUnavailableException
-   {
-      try
-      {
-         return serviceFactory.getService(clazz);
-      }
-      catch (Exception e)
-      {
-         throw new InvokerUnavailableException("Couldn't access " + description + " service. Cause: "
-            + e.getLocalizedMessage(), e);
-      }
-   }
-
-   // Service description support methods ******************************************************************************
-
-   private ServiceDescription getServiceDescriptionAndRegisterIfNeeded() throws ServiceDescriptionUnavailableException, PortletInvokerException
-   {
-      // try initial registration if needed
-      initializeProducerInteractionAndRegisterIfPossible();
-      GetServiceDescription request = getServiceDescriptionRequest();
-      request.setRegistrationContext(registrationContext);
-
-      final String producerId = getProducerId();
-
-      ServiceDescription serviceDescription;
-      try
-      {
-         serviceDescription = getServiceDescriptionService().getServiceDescription(request);
-
-         if (serviceDescription != null)
-         {
-            // from now on (that is until getServiceDescription fails) use this successful request
-            setServiceDescriptionRequest(request);
-            return serviceDescription;
-         }
-         else
-         {
-            // fix-me: do something better
-            throw new NullPointerException("null service description: deal with it!");
-         }
-      }
-      catch (Exception e)
-      {
-         log.debug("Caught Exception in getServiceDescriptionAndRegisterIfNeeded:\n", e);
-         Throwable cause = e.getCause();
-         throw new ServiceDescriptionUnavailableException("Problem getting service description for producer "
-            + producerId, cause == null ? e : cause);
-      }
-   }
-
    /**
-    * Examine the producer's metadata and attempts to register if required by the producer and possible.
+    * Refreshes the producer information if needed
     *
     * @throws org.jboss.portal.portlet.PortletInvokerException
     *
     * @since 2.6
     */
-   private void initializeProducerInteractionAndRegisterIfPossible() throws PortletInvokerException
+   private void refreshProducerInfo() throws PortletInvokerException
    {
-      // this could be optimized if we could ensure that the service description hadn't changed
-      // in particular with consumer.MarkupTestCase.testInitCookie, we change the cookie requirements
-      // and we need to be able to detect it... :( todo: use extensions for JBoss to JBoss?
-      ServiceDescription serviceDescription = getMinimalServiceDescription();
-
-      // do we need to call initCookie or not?
-      sessionHandler.setRequiresInitCookie(serviceDescription.getRequiresInitCookie());
-
-      //todo: could extract more information here...
-
-      // no registrationContext and the producer didn't already indicate that it didn't require registration
-      if (registrationContext == null && !REGISTRATION_NOT_NEEDED.equals(registrationData))
-      {
-         examineProducerMetadataAndGetRegistrationDataIfPossible(serviceDescription);
-
-         if (!REGISTRATION_NOT_NEEDED.equals(registrationData))
-         {
-            try
-            {
-               registrationContext = getRegistrationService().register(registrationData);
-               if (registrationContext == null)
-               {
-                  throw new PortletInvokerException("Received null response from producer '" + producerId + "'");
-               }
-
-               log.info("Successfully registered with handle: '" + registrationContext.getRegistrationHandle() + "'");
-            }
-            catch (Exception e)
-            {
-               resetRegistration();
-               throw new PortletInvokerException("Couldn't register with producer '" + producerId + "'", e);
-            }
-         }
-      }
-   }
-
-   /**
-    * @param serviceDescription
-    * @throws ServiceDescriptionUnavailableException
-    *
-    * @throws PortletInvokerException
-    * @since 2.6
-    */
-   private void examineProducerMetadataAndGetRegistrationDataIfPossible(ServiceDescription serviceDescription) throws PortletInvokerException
-   {
-      if (serviceDescription.isRequiresRegistration())
-      {
-         StringBuffer message = new StringBuffer("Producer '").append(producerId)
-            .append("' requires registration. Configuration for this producer might need to be updated to register.");
-         log.info(message);
-
-         ModelDescription registrationProperties = serviceDescription.getRegistrationPropertyDescription();
-         if (registrationProperties != null)
-         {
-            PropertyDescription[] propertyDescriptions = registrationProperties.getPropertyDescriptions();
-            Map descriptionsMap = getNamedMappingFrom(propertyDescriptions, false);
-            Property[] regProps;
-            if (registrationData != null)
-            {
-               regProps = registrationData.getRegistrationProperties();
-            }
-            else
-            {
-               regProps = null;
-            }
-            Map propertiesMap = getNamedMappingFrom(regProps, true);
-
-            if (descriptionsMap.size() < propertiesMap.size())
-            {
-               resetRegistration();
-               throw new PortletInvokerException("The provided registration contains more information than required by producer '"
-                  + producerId + "'");
-            }
-
-            StringBuffer missingProps = new StringBuffer();
-            for (Iterator descriptionNames = descriptionsMap.keySet().iterator(); descriptionNames.hasNext();)
-            {
-               String name = (String)descriptionNames.next();
-               Object prop = propertiesMap.get(name);
-               if (prop == null)
-               {
-                  PropertyDescription propertyDescription = (PropertyDescription)descriptionsMap.get(name);
-                  String type = propertyDescription.getType().toString();
-                  LocalizedString nillableLabel = propertyDescription.getLabel();
-                  String label = nillableLabel == null ? null : nillableLabel.getValue();
-                  LocalizedString nillableHint = propertyDescription.getHint();
-                  String hint = nillableHint == null ? null : nillableHint.getValue();
-                  missingProps.append("Missing value for registration property named '").append(name).append("' with type '")
-                     .append(type).append("' (label: '").append(label).append("', hint: '").append(hint)
-                     .append("')\n");
-               }
-            }
-
-            if (missingProps.length() > 0)
-            {
-               log.info(missingProps);
-               resetRegistration();
-               throw new PortletInvokerException("Provided registration data is invalid:\n" + missingProps);
-            }
-         }
-         else
-         {
-            log.info("The producer didn't require any specific registration properties.");
-            if (registrationData != null)
-            {
-               resetRegistration();
-               throw new PortletInvokerException("Registration data is available for producer '"
-                  + producerId + "' when none is expected by the producer.");
-            }
-            log.info("Using default registration data for producer '" + producerId + "'");
-            registrationData = WSRPTypeFactory.createDefaultRegistrationData();
-         }
-      }
-      else
-      {
-         // the producer doesn't need registration, let this consumer know for future reference
-         registrationData = REGISTRATION_NOT_NEEDED;
-         extractOfferedPortlets(serviceDescription);
-      }
-   }
-
-   /**
-    * @return
-    * @throws PortletInvokerException
-    * @since 2.6
-    */
-   private ServiceDescription getMinimalServiceDescription()
-      throws PortletInvokerException
-   {
-      ServiceDescription serviceDescription;
       try
       {
-         serviceDescription = getServiceDescriptionService().getServiceDescription(getUnregisteredServiceDescriptionRequest());
+         producerInfo.refreshIfNeeded();
       }
-      catch (Exception e)
+      catch (ServiceDescriptionUnavailableException e)
       {
-         throw new PortletInvokerException("Couldn't access service description for producer '"
-            + getProducerId() + "'", e);
+         throw new PortletInvokerException("Unable to initialize producer '" + producerInfo.getId() + "'", e);
       }
-      return serviceDescription;
+      sessionHandler.setRequiresInitCookie(producerInfo.getRequiresInitCookie());
    }
 
-   /** @since 2.6 */
-   private void resetRegistration()
-   {
-      registrationData = null;
-      registrationContext = null;
-   }
-
-   /**
-    * @param propertiesOrDescriptions
-    * @param isProperty
-    * @return
-    * @since 2.6
-    */
-   private Map getNamedMappingFrom(Object[] propertiesOrDescriptions, boolean isProperty)
-   {
-      if (propertiesOrDescriptions != null)
-      {
-         Map result = new HashMap(propertiesOrDescriptions.length);
-         for (int i = 0; i < propertiesOrDescriptions.length; i++)
-         {
-            Object propertyOrDescription = propertiesOrDescriptions[i];
-            String name;
-            if (isProperty)
-            {
-               name = ((Property)propertyOrDescription).getName();
-            }
-            else
-            {
-               name = ((PropertyDescription)propertyOrDescription).getName();
-            }
-
-            result.put(name, propertyOrDescription);
-         }
-
-         return result;
-      }
-      else
-      {
-         return Collections.EMPTY_MAP;
-      }
-   }
-
-   private void setServiceDescriptionRequest(GetServiceDescription request)
-   {
-      serviceDescriptionRequest = request;
-   }
-
-   private GetServiceDescription getServiceDescriptionRequest()
-   {
-      return (serviceDescriptionRequest != null) ? serviceDescriptionRequest : getUnregisteredServiceDescriptionRequest();
-   }
-
-   /**
-    * Retrieves the service description request this consumer uses when not registered.
-    *
-    * @return the service description request this consumer uses when not registered.
-    */
-   private GetServiceDescription getUnregisteredServiceDescriptionRequest()
-   {
-      return unregisteredServiceDescriptionRequest;
-   }
-
-   /**
-    * Initializes the service description request this consumer uses when not registered. TODO: Implement
-    * customization.
-    *
-    * @return the service description request this consumer uses when not registered.
-    */
-   private GetServiceDescription initUnregisteredServiceDescriptionRequest()
-   {
-      GetServiceDescription gsd = WSRPTypeFactory.createGetServiceDescription();
-
-      gsd.setDesiredLocales(WSRPConstants.DEFAULT_LOCALES);
-      return gsd;
-   }
-
 // Support methods **************************************************************************************************
 
    private String getUserContextKeyFor(UserContext userContext)
@@ -1071,7 +577,7 @@
    }
 
    // fix-me!
-   org.jboss.portal.wsrp.core.UserContext getUserContextFrom(PortletInvocation invocation, RuntimeContext runtimeContext)
+   org.jboss.portal.wsrp.core.UserContext getUserContextFrom(PortletInvocation invocation, RuntimeContext runtimeContext) throws PortletInvokerException
    {
       // first decide if we need to pass the user context...
       WSRPPortletInfo info = getPortletInfo(invocation);
@@ -1096,7 +602,7 @@
       return null;
    }
 
-   void setTemplatesIfNeeded(PortletInvocation invocation, RuntimeContext runtimeContext)
+   void setTemplatesIfNeeded(PortletInvocation invocation, RuntimeContext runtimeContext) throws PortletInvokerException
    {
       // todo: could store templates in producer session info to avoid to re-generate them all the time?
       WSRPPortletInfo info = getPortletInfo(invocation);

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerService.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPConsumerService.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -36,9 +36,6 @@
 {
 
    /** . */
-   private String id;
-
-   /** . */
    private WSRPConsumer consumer;
 
    /** . */
@@ -56,14 +53,9 @@
 
    public String getId()
    {
-      return id;
+      return consumer.getProducerId();
    }
 
-   public void setId(String id)
-   {
-      this.id = id;
-   }
-
    public PortletInvoker getPortletInvoker()
    {
       return consumer;
@@ -82,7 +74,6 @@
    protected void startService() throws Exception
    {
       federatingPortletInvoker.registerInvoker(this);
-      consumer.setProducerId(getId());
    }
 
    protected void stopService() throws Exception

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeploymentFactory.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -23,10 +23,10 @@
 package org.jboss.portal.wsrp.deployment;
 
 import org.jboss.logging.Logger;
-import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
+import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
 import org.jboss.portal.wsrp.consumer.WSRPConsumerImpl;
-import org.jboss.portal.wsrp.core.Property;
-import org.jboss.portal.wsrp.core.RegistrationData;
 import org.jboss.portal.wsrp.services.AbstractJNDIServiceFactory;
 import org.jboss.portal.wsrp.services.PerEndpointSOAPInvokerServiceFactory;
 import org.jboss.portal.wsrp.services.RemoteSOAPInvokerServiceFactory;
@@ -35,8 +35,6 @@
 import org.jboss.xb.binding.UnmarshallingContext;
 import org.xml.sax.Attributes;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Properties;
 
 /**
@@ -54,11 +52,16 @@
    private static final String WSRP_PRODUCER = "wsrp-producer";
 
    /** . */
-   private List properties = new ArrayList();
-
-   /** . */
    private static Properties serviceFactoryMapping;
 
+   public static class Property
+   {
+      String name;
+      String value;
+      String lang;
+   }
+
+
    static
    {
       // fix-me: this is hardcoded from values from portal-wsrp-client.jar/META-INF/jboss-client.xml... NOT GOOD!
@@ -93,7 +96,8 @@
       if (WSRP_PRODUCER.equals(localName))
       {
          WSRPConsumerService service = new WSRPConsumerService();
-         service.setConsumer(new WSRPConsumerImpl());
+         WSRPConsumerImpl consumer = new WSRPConsumerImpl();
+         service.setConsumer(consumer);
          return service;
       }
       else
@@ -110,8 +114,10 @@
          System.out.println("newchild service " + localName);
       }
 
+      ProducerInfo prodInfo = service.getConsumer().getProducerInfo();
+
       AbstractJNDIServiceFactory serviceFactory = null;
-      RegistrationData registrationData = null;
+      RegistrationInfo regInfo = null;
       if ("endpoint-config".equals(localName))
       {
          serviceFactory = new PerEndpointSOAPInvokerServiceFactory();
@@ -122,17 +128,18 @@
       }
       else if ("registration-data".equals(localName))
       {
-         registrationData = WSRPTypeFactory.createDefaultRegistrationData();
+         regInfo = new RegistrationInfo(prodInfo);
       }
 
       if (serviceFactory != null)
       {
          serviceFactory.setPortJNDIMapping(serviceFactoryMapping);
+         new EndpointConfigurationInfo(prodInfo, serviceFactory);
          return serviceFactory;
       }
-      else if (registrationData != null)
+      else if (regInfo != null)
       {
-         return registrationData;
+         return regInfo;
       }
       else
       {
@@ -140,12 +147,12 @@
       }
    }
 
-   public Object newChild(RegistrationData registrationData, UnmarshallingContext nav, String nsURI, String localName,
+   public Object newChild(RegistrationInfo registrationInfo, UnmarshallingContext nav, String nsURI, String localName,
                           Attributes attrs)
    {
       if (DEBUG)
       {
-         System.out.println("newChild registrationdata " + localName);
+         System.out.println("newChild registrationInfo " + localName);
       }
 
       if ("property".equals(localName))
@@ -163,16 +170,17 @@
          System.out.println("setvalue service " + localName);
       }
 
+      ProducerInfo prodInfo = service.getConsumer().getProducerInfo();
       if ("producer-id".equals(localName))
       {
-         service.setId(value);
+         prodInfo.setId(value);
       }
       else if ("expiration-cache".equals(localName))
       {
          try
          {
             Integer expirationCacheMillis = new Integer(value);
-            service.getConsumer().setExpirationCacheSeconds(expirationCacheMillis);
+            prodInfo.setExpirationCacheSeconds(expirationCacheMillis);
          }
          catch (NumberFormatException e)
          {
@@ -224,18 +232,18 @@
       }
    }
 
-   public void setValue(RegistrationData registrationData, UnmarshallingContext nav, String nsURI, String localName,
+   public void setValue(RegistrationInfo registrationInfo, UnmarshallingContext nav, String nsURI, String localName,
                         String value)
    {
       if (DEBUG)
       {
-         System.out.println("setvalue registrationdata " + localName);
+         System.out.println("setvalue registrationinfo " + localName);
       }
 
       if ("consumer-name".equals(localName))
       {
          value = StringPropertyReplacer.replaceProperties(value);
-         registrationData.setConsumerName(value);
+         registrationInfo.setConsumerName(value);
       }
    }
 
@@ -249,53 +257,29 @@
       if ("name".equals(localName))
       {
          value = StringPropertyReplacer.replaceProperties(value);
-         property.setName(value);
+         property.name = value;
       }
       else if ("lang".equals(localName))
       {
          value = StringPropertyReplacer.replaceProperties(value);
-         property.setLang(value);
+         property.lang = value;
       }
       else if ("value".equals(localName))
       {
          value = StringPropertyReplacer.replaceProperties(value);
-         property.setStringValue(value);
+         property.value = value;
       }
    }
 
-   public void addChild(RegistrationData registrationData, Property property, UnmarshallingContext nav, String nsURI,
-                        String localName)
-   {
-      if (DEBUG)
-      {
-         System.out.println("addchild registrationdata property " + localName);
-      }
-
-      properties.add(property);
-   }
-
-   public void addChild(WSRPConsumerService service, RegistrationData registrationData, UnmarshallingContext nav,
-                        String nsURI, String localName)
-   {
-      if (DEBUG)
-      {
-         System.out.println("addchild service registrationdata " + localName);
-      }
-
-      Property[] propertyArray = (Property[])properties.toArray(new Property[0]);
-      registrationData.setRegistrationProperties(propertyArray);
-      service.getConsumer().setRegistrationData(registrationData);
-   }
-
-   public void addChild(WSRPConsumerService service, PerEndpointSOAPInvokerServiceFactory serviceFactory,
+   public void addChild(RegistrationInfo registrationInfo, Property property,
                         UnmarshallingContext nav, String nsURI, String localName)
    {
       if (DEBUG)
       {
-         System.out.println("addchild service servicefactory " + localName);
+         System.out.println("addchild registrationinfo property " + localName);
       }
 
-      service.getConsumer().setServiceFactory(serviceFactory);
+      registrationInfo.setRegistrationPropertyValue(property.name, property.value).setLang(property.lang);
    }
 
    public void addChild(WSRPDeployment deployment, WSRPConsumerService service, UnmarshallingContext nav, String nsURI,
@@ -306,15 +290,19 @@
          System.out.println("addchild deployment service " + localName);
       }
 
+      String message;
       if (service.getConsumer().getServiceFactory().isAvailable())
       {
-         log.info("Added consumer for producer '" + service.getId() + "'");
+         message = "Added consumer for producer '" + service.getId() + "'";
          deployment.getServices().add(service);
       }
       else
       {
-         log.info("There was a problem initializing the WSRP interface for producer '"
-            + service.getId() + "'. The consumer will NOT be available.");
+         message = "There was a problem initializing the WSRP interface for producer '"
+            + service.getId() + "'. The consumer will NOT be available.";
       }
+
+      log.info(message);
+      System.out.println("message = " + message);
    }
 }

Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java	2007-01-08 02:49:44 UTC (rev 5950)
@@ -80,6 +80,15 @@
       parent = other.parent;
    }
 
+
+   public String toString()
+   {
+      return "Registration Property Description named '" + name +
+         "', type=" + type +
+         ", hint=" + hint +
+         ", label=" + label;
+   }
+
    public QName getName()
    {
       return name;

Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsp/consumers/consumer.jsp	2007-01-08 02:49:44 UTC (rev 5950)
@@ -1,5 +1,6 @@
 <%@ page import="org.jboss.portal.wsrp.WSRPConsumer" %>
 <%@ page import="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo" %>
+<%@ page import="org.jboss.portal.wsrp.consumer.ProducerInfo" %>
 <%@ page import="org.jboss.portal.wsrp.consumer.RegistrationInfo" %>
 <%@ page import="org.jboss.portal.wsrp.portlet.consumers.ConsumersRegistry" %>
 <%@ page import="org.jboss.portal.wsrp.portlet.consumers.WSRPConsumerConfigurationPortlet" %>
@@ -17,8 +18,9 @@
       // todo: do something... :)
    }
    WSRPConsumer consumer = registry.getConsumer(id);
-   RegistrationInfo regInfo = consumer.getRegistrationInfo();
-   EndpointConfigurationInfo endInfo = consumer.getEndpointConfigurationInfo();
+   ProducerInfo info = consumer.getProducerInfo();
+   RegistrationInfo regInfo = info.getRegistrationInfo();
+   EndpointConfigurationInfo endInfo = info.getEndpointConfigurationInfo();
 %>
 
 <div class="portlet-section-body">
@@ -27,19 +29,19 @@
       <portlet:param name="<%=WSRPConsumerConfigurationPortlet.OP%>" value="<%=WSRPConsumerConfigurationPortlet.OP_EDIT%>"/>
       </portlet:actionURL>" method="post">
 <table width="100%" border="1" cellspacing="0" class="portlet-table-body">
-<caption class="portlet-table-header">Consumer '<%= consumer.getProducerId()%>'</caption>
+<caption class="portlet-table-header">Consumer '<%= info.getId()%>'</caption>
 <tbody>
 <tr>
    <th>Producer id:</th>
 
-   <td><input type="text" name="producer-id" value="<%=consumer.getProducerId()%>"/></td>
+   <td><input type="text" name="producer-id" value="<%=info.getId()%>"/></td>
 </tr>
 
 <tr>
    <th>Cache expiration:</th>
 
    <td><input type="text" name="cache-expiration"
-              value="<%=consumer.getExpirationCacheSeconds().intValue()%>"/> seconds
+              value="<%=info.getExpirationCacheSeconds().intValue()%>"/> seconds
    </td>
 </tr>
 

Modified: trunk/wsrp/src/resources/tests/test-deployment-lib-jar/test-wsrp.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-deployment-lib-jar/test-wsrp.xml	2007-01-08 02:29:12 UTC (rev 5949)
+++ trunk/wsrp/src/resources/tests/test-deployment-lib-jar/test-wsrp.xml	2007-01-08 02:49:44 UTC (rev 5950)
@@ -48,7 +48,7 @@
       <wsrp-producer>
          <producer-id>producer1</producer-id>
          <expiration-cache>120</expiration-cache>
-         <endpoint-wsdl-url>http://portalstandards.oracle.com/portletapp/portlets?WSDL</endpoint-wsdl-url>
+         <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
          <registration-data>
             <consumer-name>JBoss Portal 2.4 Test</consumer-name>
             <property>




More information about the portal-commits mailing list