Author: chris.laprun(a)jboss.com
Date: 2007-01-08 19:35:52 -0500 (Mon, 08 Jan 2007)
New Revision: 5968
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
Log:
- More behavioral fixes to registration handling.
Modified: 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
22:47:50 UTC (rev 5967)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-01-09
00:35:52 UTC (rev 5968)
@@ -157,40 +157,44 @@
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()))
+ // only process service description if consumer is not already registered
+ if (!registrationInfo.isRegistrationValid())
{
- try
+ // check if the configured registration information is correct and if we
can get the service description
+ if (registrationInfo.initialize(serviceDescription, getId()))
{
- log.debug("Attempting registration");
- RegistrationContext registrationContext =
endpointConfigurationInfo.getRegistrationService()
- .register(registrationInfo.getRegistrationData());
+ try
+ {
+ log.debug("Attempting registration");
+ RegistrationContext registrationContext =
endpointConfigurationInfo.getRegistrationService()
+ .register(registrationInfo.getRegistrationData());
- if (registrationContext == null)
+ 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)
{
- throw new PortletInvokerException("Received null response after
registration from producer '" + producerId + "'");
+ registrationInfo.resetRegistration();
+ throw new PortletInvokerException("Couldn't register with
producer '" + producerId + "'", e);
}
- //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() + "'");
+ log.debug("Requesting service description after
registration");
+ extractOfferedPortlets(getServiceDescription());
+ isInitialized = true;
}
- catch (Exception e)
+ else
{
- registrationInfo.resetRegistration();
- throw new PortletInvokerException("Couldn't register with
producer '" + producerId + "'", e);
+ log.info("Consumer is not ready to be registered with producer
because of missing or invalid registration information.");
+ isInitialized = false;
}
-
- 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;
- }
}
else
{
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
22:47:50 UTC (rev 5967)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-01-09
00:35:52 UTC (rev 5968)
@@ -205,7 +205,7 @@
{
log.debug("RegistrationInfo initialization requested");
boolean configurationValid;
- if (serviceDescription.isRequiresRegistration() && !isRegistrationValid())
+ if (serviceDescription.isRequiresRegistration())
{
requiresRegistration = true;
StringBuffer message = new StringBuffer("Producer
'").append(producerId).append("' requires registration.");