geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r526110 - in /geronimo/server/trunk/modules: geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25...
Date Fri, 06 Apr 2007 09:42:44 GMT
Author: djencks
Date: Fri Apr  6 02:42:41 2007
New Revision: 526110

URL: http://svn.apache.org/viewvc?view=rev&rev=526110
Log:
GERONIMO-3070 only generate web app dependencies onto stuff in the current ear, not all the
parents

Modified:
    geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?view=diff&rev=526110&r1=526109&r2=526110
==============================================================================
--- geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
(original)
+++ geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
Fri Apr  6 02:42:41 2007
@@ -184,6 +184,10 @@
         return configuration.findGBeans(pattern);
     }
 
+    public LinkedHashSet<GBeanData> findGBeanDatas(Configuration configuration, AbstractNameQuery
pattern) {
+        return configuration.findGBeanDatas(configuration, Collections.singleton(pattern));
+    }
+
     public LinkedHashSet<AbstractName> findGBeans(Set<AbstractNameQuery> patterns)
{
         return configuration.findGBeans(patterns);
     }

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?view=diff&rev=526110&r1=526109&r2=526110
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Fri Apr  6 02:42:41 2007
@@ -714,7 +714,7 @@
      * @param patterns patterns to look for
      * @return set of gbeandatas matching one of the patterns from this configuration only,
not including parents.
      */
-    private LinkedHashSet<GBeanData> findGBeanDatas(Configuration configuration, Set<AbstractNameQuery>
patterns) {
+    public LinkedHashSet<GBeanData> findGBeanDatas(Configuration configuration, Set<AbstractNameQuery>
patterns) {
         LinkedHashSet<GBeanData> result = new LinkedHashSet<GBeanData>();
 
         Set<Map.Entry<AbstractName, GBeanData>> gbeanNames = configuration.getGBeans().entrySet();

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?view=diff&rev=526110&r1=526109&r2=526110
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Fri Apr  6 02:42:41 2007
@@ -35,6 +35,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.LinkedHashSet;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
@@ -155,15 +156,20 @@
         return namingBuilders;
     }
 
-    //TODO configid these need to be converted to ReferencePatterns
-    protected Set findGBeanDependencies(EARContext earContext) {
-        Set<AbstractName> dependencies = new HashSet<AbstractName>();
-        dependencies.addAll(earContext.listGBeans(MANAGED_CONNECTION_FACTORY_PATTERN));
-        dependencies.addAll(earContext.listGBeans(ADMIN_OBJECT_PATTERN));
-        dependencies.addAll(earContext.listGBeans(STATELESS_SESSION_BEAN_PATTERN));
-        dependencies.addAll(earContext.listGBeans(STATEFUL_SESSION_BEAN_PATTERN));
-        dependencies.addAll(earContext.listGBeans(ENTITY_BEAN_PATTERN));
-        return dependencies;
+    protected void addGBeanDependencies(EARContext earContext, GBeanData webModuleData) {
+        Configuration earConfiguration = earContext.getConfiguration();
+        addDependencies(earContext.findGBeanDatas(earConfiguration, MANAGED_CONNECTION_FACTORY_PATTERN),
webModuleData);
+        addDependencies(earContext.findGBeanDatas(earConfiguration, ADMIN_OBJECT_PATTERN),
webModuleData);
+        addDependencies(earContext.findGBeanDatas(earConfiguration, STATELESS_SESSION_BEAN_PATTERN),
webModuleData);
+        addDependencies(earContext.findGBeanDatas(earConfiguration, STATEFUL_SESSION_BEAN_PATTERN),
webModuleData);
+        addDependencies(earContext.findGBeanDatas(earConfiguration, ENTITY_BEAN_PATTERN),
webModuleData);
+    }
+
+    private void addDependencies(LinkedHashSet<GBeanData> dependencies, GBeanData webModuleData)
{
+        for (GBeanData dependency: dependencies) {
+            AbstractName dependencyName = dependency.getAbstractName();
+            webModuleData.addDependency(dependencyName);
+        }
     }
 
     public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder
idBuilder) throws DeploymentException {
@@ -812,8 +818,9 @@
         //Add dependencies on managed connection factories and ejbs in this app
         //This is overkill, but allows for people not using java:comp context (even though
we don't support it)
         //and sidesteps the problem of circular references between ejbs.
-        Set dependencies = findGBeanDependencies(earContext);
-        webModuleData.addDependencies(dependencies);
+        if (earContext != moduleContext) {
+            addGBeanDependencies(earContext, webModuleData);
+        }
 
         webModuleData.setAttribute("componentContext", compContext);
         webModuleData.setReferencePattern("TransactionManager", moduleContext.getTransactionManagerName());



Mime
View raw message