You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2010/08/21 01:42:14 UTC

svn commit: r987671 - /tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java

Author: rfeng
Date: Fri Aug 20 23:42:13 2010
New Revision: 987671

URL: http://svn.apache.org/viewvc?rev=987671&view=rev
Log:
Relax the sca:service target validation

Modified:
    tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java?rev=987671&r1=987670&r2=987671&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java Fri Aug 20 23:42:13 2010
@@ -124,7 +124,25 @@ public class SpringXMLComponentTypeLoade
             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 SpringXMLComponentTypeLoade
                 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/>