Author: chris.laprun(a)jboss.com
Date: 2006-12-12 22:47:58 -0500 (Tue, 12 Dec 2006)
New Revision: 5814
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
Log:
Improved handling of missing registration data so that it can be more easily reported to
users.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2006-12-12
22:44:20 UTC (rev 5813)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2006-12-13
03:47:58 UTC (rev 5814)
@@ -538,16 +538,17 @@
else
{
ModelDescription registrationProperties =
serviceDescription.getRegistrationPropertyDescription();
- log.info("Producer " + producerId + " requires
registration yet configuration of this producer " +
- "does not provide any registration data. You must at least
provide a consumer-name in the " +
- "configuration for this producer. Please refer to the
documentation.");
+ StringBuffer message = new StringBuffer("Producer
'").append(producerId)
+ .append("' requires registration yet configuration of this
producer does not provide any ")
+ .append("registration data. Please refer to the documentation
on how to configure a remote producer.");
+ log.info(message);
if (registrationProperties != null)
{
PropertyDescription[] propertyDescriptions =
registrationProperties.getPropertyDescriptions();
if (propertyDescriptions != null)
{
- log.info("Additionally, the producer required the following
registration information: ");
+ message.append("\nAdditionally, the producer required the
following registration information: ");
for (int i = 0; i < propertyDescriptions.length; i++)
{
PropertyDescription propertyDescription =
propertyDescriptions[i];
@@ -557,14 +558,13 @@
String label = nillableLabel == null ? null :
nillableLabel.getValue();
LocalizedString nillableHint = propertyDescription.getHint();
String hint = nillableHint == null ? null :
nillableHint.getValue();
- log.info("propertyDescription =\n"
- + "- name:\t" + name + "\n"
- + "- type:\t" + type + "\n"
- + "- label:\t" + label + "\n"
- + "- hint:\t" + hint + "\n");
+ message.append("propertyDescription =\n-
name:\t").append(name).append("\n- type:\t")
+ .append(type).append("\n-
label:\t").append(label).append("\n- hint:\t").append(hint)
+ .append("\n");
}
}
}
+ throw new ServiceDescriptionUnavailableException(message.toString(),
null);
}
}
@@ -582,6 +582,10 @@
throw new NullPointerException("null service description: deal with
it!");
}
}
+ catch (ServiceDescriptionUnavailableException e)
+ {
+ throw e;
+ }
catch (Exception e)
{
log.debug(e);
Show replies by date