summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-08-20 23:42:13 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-08-20 23:42:13 +0000
commit6b8b3bf378b5a3e280e5ee5ed0540e45b96699ca (patch)
tree0cdb11807f655932663c4cf0e82c983cba9e1d80 /sca-java-2.x/trunk
parent077e1654ce286d8631d2611ff1d87d589bcc5dd2 (diff)
Relax the sca:service target validation
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@987671 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java b/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
index 2730ee3146..1b0ad108fb 100644
--- a/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
+++ b/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
@@ -124,7 +124,25 @@ public class SpringXMLComponentTypeLoader {
monitor.problem(problem);
}
}
-
+ /**
+ * Report a error.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void warning(Monitor monitor, String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem =
+ monitor.createProblem(this.getClass().getName(),
+ "impl-spring-validation-messages",
+ Severity.WARNING,
+ model,
+ message,
+ (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
protected Class<SpringImplementation> getImplementationClass() {
return SpringImplementation.class;
}
@@ -605,8 +623,11 @@ public class SpringXMLComponentTypeLoader {
if (serviceElement.getTarget().equals(beanElement.getId()))
targetBeanExists = true;
}
- if (!targetBeanExists)
- error(monitor, "TargetBeanDoesNotExist", beans);
+ if (!targetBeanExists) {
+ // REVIEW: [rfeng] The target bean can exist in the parent Spring application context which we don't know
+ // until runtime
+ warning(monitor, "TargetBeanDoesNotExist", beans);
+ }
} // end while
// The value of the @name attribute of an <sca:reference/> subelement of a <beans/>