geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <djen...@gluecode.com>
Subject Re: svn commit: r126427 - /geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
Date Tue, 25 Jan 2005 21:33:10 GMT
I'd like to check that this doesn't violate any philosophical  
principles behind deployment.  I think that all classes used at runtime  
should be available at deployment time: this patch checks that all  
dependencies are in fact present at deployment time.  Any arguments?

thanks
david jencks

On Jan 25, 2005, at 1:30 PM, djencks@apache.org wrote:

> Author: djencks
> Date: Tue Jan 25 13:30:16 2005
> New Revision: 126427
>
> URL: http://svn.apache.org/viewcvs?view=rev&rev=126427
> Log:
> If a dependency is missing, let us know immediately, not when a class  
> can't be loaded
> Modified:
>     
> geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/ 
> deployment/service/ServiceConfigBuilder.java
>
> Modified:  
> geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/ 
> deployment/service/ServiceConfigBuilder.java
> Url:  
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/ 
> src/java/org/apache/geronimo/deployment/service/ 
> ServiceConfigBuilder.java?view=diff&rev=126427&p1=geronimo/trunk/ 
> modules/service-builder/src/java/org/apache/geronimo/deployment/ 
> service/ServiceConfigBuilder.java&r1=126426&p2=geronimo/trunk/modules/ 
> service-builder/src/java/org/apache/geronimo/deployment/service/ 
> ServiceConfigBuilder.java&r2=126427
> ======================================================================= 
> =======
> ---  
> geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/ 
> deployment/service/ServiceConfigBuilder.java	(original)
> +++  
> geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/ 
> deployment/service/ServiceConfigBuilder.java	Tue Jan 25 13:30:16 2005
> @@ -53,6 +53,7 @@
>  import org.apache.geronimo.kernel.Kernel;
>  import org.apache.geronimo.kernel.config.ConfigurationModuleType;
>  import org.apache.geronimo.kernel.repository.Repository;
> +import  
> org.apache.geronimo.kernel.repository.MissingDependencyException;
>  import org.apache.xmlbeans.XmlException;
>
>  /**
> @@ -153,7 +154,7 @@
>      public static void addIncludes(DeploymentContext context,  
> DependencyType[] includes, Repository repository) throws  
> DeploymentException {
>          for (int i = 0; i < includes.length; i++) {
>              DependencyType include = includes[i];
> -            URI uri = getDependencyURI(include);
> +            URI uri = getDependencyURI(include, repository);
>              String name = uri.toString();
>              int idx = name.lastIndexOf('/');
>              if (idx != -1) {
> @@ -176,7 +177,7 @@
>
>      public static void addDependencies(DeploymentContext context,  
> DependencyType[] deps, Repository repository) throws  
> DeploymentException {
>          for (int i = 0; i < deps.length; i++) {
> -            URI dependencyURI = getDependencyURI(deps[i]);
> +            URI dependencyURI = getDependencyURI(deps[i], repository);
>              context.addDependency(dependencyURI);
>
>              URL url;
> @@ -264,7 +265,7 @@
>          return gBeanData;
>      }
>
> -    private static URI getDependencyURI(DependencyType dep) throws  
> DeploymentException {
> +    private static URI getDependencyURI(DependencyType dep,  
> Repository repository) throws DeploymentException {
>          URI uri;
>          if (dep.isSetUri()) {
>              try {
> @@ -280,6 +281,9 @@
>              } catch (URISyntaxException e) {
>                  throw new DeploymentException("Unable to construct  
> URI for groupId=" + dep.getGroupId() + ", artifactId=" +  
> dep.getArtifactId() + ", version=" + dep.getVersion(), e);
>              }
> +        }
> +        if (!repository.hasURI(uri)) {
> +            throw new DeploymentException(new  
> MissingDependencyException("uri " + uri + " not found in  
> repository"));
>          }
>          return uri;
>      }
>


Mime
View raw message