tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r513915 - /incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeLoader.java
Date Fri, 02 Mar 2007 19:47:23 GMT
Author: jboynes
Date: Fri Mar  2 11:47:22 2007
New Revision: 513915

URL: http://svn.apache.org/viewvc?view=rev&rev=513915
Log:
throw MissingResourceEx if a dependency cannot be resolved

Modified:
    incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeLoader.java

Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeLoader.java?view=diff&rev=513915&r1=513914&r2=513915
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeLoader.java
(original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeLoader.java
Fri Mar  2 11:47:22 2007
@@ -38,6 +38,7 @@
 import org.apache.tuscany.spi.loader.InvalidWireException;
 import org.apache.tuscany.spi.loader.LoaderException;
 import org.apache.tuscany.spi.loader.LoaderRegistry;
+import org.apache.tuscany.spi.loader.MissingResourceException;
 import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.ComponentType;
 import org.apache.tuscany.spi.model.CompositeComponentType;
@@ -104,20 +105,26 @@
                         type.add((Include) o);
                     } else if (o instanceof Dependency) {
                         Artifact artifact = ((Dependency) o).getArtifact();
-                        if (artifactRepository != null) {
-                            // default to jar type if not specified
-                            if (artifact.getType() == null) {
-                                artifact.setType("jar");
-                            }
-                            artifactRepository.resolve(artifact);
+                        if (artifactRepository == null) {
+                            throw new MissingResourceException("No ArtifactRepository configured
for this system",
+                                                               artifact.toString()
+                                                               );
                         }
-                        if (artifact.getUrl() != null) {
-                            ClassLoader classLoader = deploymentContext.getClassLoader();
-                            if (classLoader instanceof CompositeClassLoader) {
-                                CompositeClassLoader ccl = (CompositeClassLoader) classLoader;
-                                for (URL dep : artifact.getUrls()) {
-                                    ccl.addURL(dep);
-                                }
+
+                        // default to jar type if not specified
+                        if (artifact.getType() == null) {
+                            artifact.setType("jar");
+                        }
+                        artifactRepository.resolve(artifact);
+                        if (artifact.getUrl() == null) {
+                            throw new MissingResourceException("Dependency not found", artifact.toString());
+                        }
+
+                        ClassLoader classLoader = deploymentContext.getClassLoader();
+                        if (classLoader instanceof CompositeClassLoader) {
+                            CompositeClassLoader ccl = (CompositeClassLoader) classLoader;
+                            for (URL dep : artifact.getUrls()) {
+                                ccl.addURL(dep);
                             }
                         }
                     } else if (o instanceof WireDefinition) {



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message