geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r921197 - in /geronimo/server/trunk/framework: buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ configs/client-system/src/main/plan/ configs/j2ee-system/src/main/plan/ modules/geronimo-system/src/main/java/o...
Date Wed, 10 Mar 2010 00:43:49 GMT
Author: djencks
Date: Wed Mar 10 00:43:48 2010
New Revision: 921197

URL: http://svn.apache.org/viewvc?rev=921197&view=rev
Log:
GERONIMO-5176 tell the DependencyManager about artifact aliases

Modified:
    geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java
    geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginBootstrap2.java
    geronimo/server/trunk/framework/configs/client-system/src/main/plan/plan.xml
    geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java?rev=921197&r1=921196&r2=921197&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PackageMojo.java
Wed Mar 10 00:43:48 2010
@@ -403,8 +403,6 @@ public class PackageMojo extends Abstrac
         kernel = KernelFactory.newInstance(bundleContext).createKernel(KERNEL_NAME);
         kernel.boot();
         AbstractName sourceRepoName = bootDeployerSystem();
-        Repository sourceRepo = (Repository) kernel.getGBean(sourceRepoName);
-        new DependencyManager(bundleContext, Collections.<Repository>singleton(sourceRepo));
         Dictionary dictionary = null;
         ServiceRegistration kernelRegistration = bundleContext.registerService(Kernel.class.getName(),
kernel, dictionary);
 
@@ -465,6 +463,10 @@ public class PackageMojo extends Abstrac
         artifactResolverGBean.setReferencePatterns("Repositories", repoPatterns);
         artifactResolverGBean.setReferencePattern("ArtifactManager", artifactManagerGBean.getAbstractName());
 
+        GBeanData dependencyManager = bootstrap.addGBean("DependencyManager", DependencyManager.class);
+        dependencyManager.setReferencePattern("Repositories", repoGBean.getAbstractName());
+        dependencyManager.setReferencePattern("ArtifactResolver", artifactResolverGBean.getAbstractName());
+
         Set storeNames = new HashSet();
 
         // Source config store

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginBootstrap2.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginBootstrap2.java?rev=921197&r1=921196&r2=921197&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginBootstrap2.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginBootstrap2.java
Wed Mar 10 00:43:48 2010
@@ -85,7 +85,7 @@ public class PluginBootstrap2 {
 //        ModuleType config = ModuleDocument.Factory.parse(plan).getModule();
 
         Maven2Repository repository = new Maven2Repository(localRepo);
-        new DependencyManager(bundleContext, Collections.<Repository>singleton(repository));
+        new DependencyManager(bundleContext, Collections.<Repository>singleton(repository),
null);
 
         GBeanBuilder gBeanBuilder = new GBeanBuilder(null, null);
         ServiceConfigBuilder builder = new ServiceConfigBuilder(null, Collections.<Repository>singleton(repository),
Collections.<NamespaceDrivenBuilder>singleton(gBeanBuilder), new Jsr77Naming(), bundleContext);

Modified: geronimo/server/trunk/framework/configs/client-system/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/client-system/src/main/plan/plan.xml?rev=921197&r1=921196&r2=921197&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/client-system/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/framework/configs/client-system/src/main/plan/plan.xml Wed Mar 10
00:43:48 2010
@@ -85,6 +85,9 @@
 
     <gbean name="DependencyManager" class="org.apache.geronimo.system.configuration.DependencyManager">
         <reference name="Repositories"></reference>
+        <reference name="ArtifactResolver">
+            <name>ArtifactResolver</name>
+        </reference>
     </gbean>
 
     <!-- Logging service -->

Modified: geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml?rev=921197&r1=921196&r2=921197&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/framework/configs/j2ee-system/src/main/plan/plan.xml Wed Mar 10
00:43:48 2010
@@ -110,6 +110,9 @@ specific services - those should be prov
 
     <gbean name="DependencyManager" class="org.apache.geronimo.system.configuration.DependencyManager">
         <reference name="Repositories"></reference>
+        <reference name="ArtifactResolver">
+            <name>ArtifactResolver</name>
+        </reference>
     </gbean>
 
     <!-- Logging service -->

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java?rev=921197&r1=921196&r2=921197&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/DependencyManager.java
Wed Mar 10 00:43:48 2010
@@ -38,6 +38,7 @@ import org.apache.geronimo.kernel.config
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.osgi.BundleUtils;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.system.plugin.model.DependencyType;
 import org.apache.geronimo.system.plugin.model.PluginArtifactType;
@@ -63,14 +64,18 @@ public class DependencyManager implement
     private final Collection<Repository> repositories;
 
     private final RepositoryAdmin repositoryAdmin;
+
+    private final ArtifactResolver artifactResolver;
     
     private final Map<Bundle, PluginArtifactType> pluginMap = 
         Collections.synchronizedMap(new WeakHashMap<Bundle, PluginArtifactType>());
 
     public DependencyManager(@ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext
bundleContext,
-                             @ParamReference(name = "Repositories", namingType = "Repository")
Collection<Repository> repositories) {
+                             @ParamReference(name = "Repositories", namingType = "Repository")
Collection<Repository> repositories,
+                             @ParamReference(name="ArtifactResolver", namingType = "ArtifactResolver")
ArtifactResolver artifactResolver) {
         this.bundleContext = bundleContext;
         this.repositories = repositories;
+        this.artifactResolver = artifactResolver;
         bundleContext.addBundleListener(this);
         ServiceReference ref = bundleContext.getServiceReference(RepositoryAdmin.class.getName());
         repositoryAdmin = ref == null? null: (RepositoryAdmin) bundleContext.getService(ref);
@@ -145,6 +150,9 @@ public class DependencyManager implement
                 for (DependencyType dependencyType : dependencies) {
                     log.info("Installing artifact: " + dependencyType);
                     Artifact artifact = dependencyType.toArtifact();
+                    if (artifactResolver != null) {
+                        artifact = artifactResolver.resolveInClassLoader(artifact);
+                    }
                     String location = locateBundle(artifact);
                     for (Bundle test: bundleContext.getBundles()) {
                         if (location.equals(test.getLocation())) {
@@ -172,6 +180,9 @@ public class DependencyManager implement
                 for (DependencyType dependencyType : dependencies) {
                     log.info("Starting artifact: " + dependencyType);
                     Artifact artifact = dependencyType.toArtifact();
+                    if (artifactResolver != null) {
+                        artifact = artifactResolver.resolveInClassLoader(artifact);
+                    }
                     String location = locateBundle(artifact);
                         
                     for (Bundle test: bundleContext.getBundles()) {



Mime
View raw message