geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r887632 - in /geronimo/server/trunk/plugins: aries/geronimo-aries-builder/src/main/java/org/apache/geronimo/aries/builder/ client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/ connector-1_6/geronimo-connector-bui...
Date Sun, 06 Dec 2009 03:46:01 GMT
Author: gawor
Date: Sun Dec  6 03:45:29 2009
New Revision: 887632

URL: http://svn.apache.org/viewvc?rev=887632&view=rev
Log:
revert r887507 - will take a different route

Added:
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableModuleBuilder.java
      - copied unchanged from r887506, geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableModuleBuilder.java
Modified:
    geronimo/server/trunk/plugins/aries/geronimo-aries-builder/src/main/java/org/apache/geronimo/aries/builder/AriesAppModuleBuilder.java
    geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java

Modified: geronimo/server/trunk/plugins/aries/geronimo-aries-builder/src/main/java/org/apache/geronimo/aries/builder/AriesAppModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/aries/geronimo-aries-builder/src/main/java/org/apache/geronimo/aries/builder/AriesAppModuleBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/aries/geronimo-aries-builder/src/main/java/org/apache/geronimo/aries/builder/AriesAppModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/aries/geronimo-aries-builder/src/main/java/org/apache/geronimo/aries/builder/AriesAppModuleBuilder.java
Sun Dec  6 03:45:29 2009
@@ -216,11 +216,4 @@
         return null;
     }
 
-    public int getPriority() {
-        return 50;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return AriesAppModule.class.isAssignableFrom(moduleType);
-    }
 }

Modified: geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Sun Dec  6 03:45:29 2009
@@ -839,14 +839,6 @@
         return GERAPPCLIENT_NAMESPACE;
     }
 
-    public int getPriority() {
-        return 40;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return AppClientModule.class.isAssignableFrom(moduleType);
-    }
-    
     public void addManifestClassPath(DeploymentContext deploymentContext, JarFile earFile,
JarFile jarFile, URI jarFileLocation) throws DeploymentException {
         Manifest manifest;
         try {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Sun Dec  6 03:45:29 2009
@@ -537,14 +537,6 @@
         return GERCONNECTOR_NAMESPACE;
     }
 
-    public int getPriority() {
-        return 30;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return ConnectorModule.class.isAssignableFrom(moduleType);
-    }
-    
     private void addConnectorGBeans(EARContext earContext, AbstractName jcaResourceName,
GBeanData resourceAdapterModuleData, ConnectorType connector, GerConnectorType geronimoConnector,
Bundle bundle) throws DeploymentException {
         ResourceadapterType resourceadapter = connector.getResourceadapter();
 

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
Sun Dec  6 03:45:29 2009
@@ -22,7 +22,6 @@
 import java.net.URL;
 import java.sql.Connection;
 import java.sql.Statement;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -30,6 +29,7 @@
 import java.util.HashMap;
 import java.util.jar.JarFile;
 
+import javax.naming.Reference;
 import javax.sql.DataSource;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -41,6 +41,7 @@
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.j2ee.deployment.ActivationSpecInfoLocator;
 import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
@@ -89,6 +90,22 @@
     private Environment defaultEnvironment;
     private ConfigurationStore configurationStore = new MockConfigStore();
     private MockRepository repository;
+
+    private ActivationSpecInfoLocator activationSpecInfoLocator = new ActivationSpecInfoLocator()
{
+
+        public Reference createResourceRef(AbstractNameQuery containerId, Class iface, Configuration
configuration) {
+            return null;
+        }
+
+        public Reference createAdminObjectRef(AbstractNameQuery containerId, Class iface,
Configuration configuration) {
+            return null;
+        }
+
+        public GBeanData locateActivationSpecInfo(AbstractNameQuery nameQuery, String messageListenerInterface,
Configuration configuration) {
+            return null;
+        }
+    };
+
     private Kernel kernel;
     private ConfigurationManager configurationManager;
     private static final Naming naming = new Jsr77Naming();
@@ -105,15 +122,17 @@
             rarFile = DeploymentUtil.createJarFile(new File(BASEDIR, "target/test-ear-noger.ear"));
             GBeanBuilder serviceBuilder = new GBeanBuilder(null, null);
 //            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, transactionContextManagerName,
connectionTrackerName, null, null, null, new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()),
null, null, ejbReferenceBuilder, null,
-            List<ModuleBuilder> builders = new ArrayList<ModuleBuilder>();
-            builders.add(new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize,
defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching,
defaultXAThreadCaching, defaultWorkManagerName, Collections.<NamespaceDrivenBuilder>singleton(serviceBuilder)));
             EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment,
                     transactionManagerName,
                     connectionTrackerName,
                     null,
                     new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()),
                     Collections.singleton(repository),
-                    builders, 
+                    null,
+                    null,
+                    new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize,
defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching,
defaultXAThreadCaching, defaultWorkManagerName, Collections.<NamespaceDrivenBuilder>singleton(serviceBuilder)),
+                    activationSpecInfoLocator,
+                    null,
                     serviceBuilder,
                     null,
                     kernel.getNaming(),

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Sun Dec  6 03:45:29 2009
@@ -24,7 +24,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -61,6 +60,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.ReferencePatterns;
+import org.apache.geronimo.gbean.SingleElementCollection;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.gbean.annotation.ParamReference;
@@ -123,7 +123,11 @@
 
     private final ConfigurationManager configurationManager;
     private final Collection<? extends Repository> repositories;
-    private final Collection<ModuleBuilder> moduleBuilders;
+    private final SingleElementCollection ejbConfigBuilder;
+    private final SingleElementCollection webConfigBuilder;
+    private final SingleElementCollection connectorConfigBuilder;
+    private final SingleElementCollection appClientConfigBuilder;
+    private final SingleElementCollection resourceReferenceBuilder;
     private final NamespaceDrivenBuilderCollection serviceBuilders;
     private final Collection<ModuleBuilderExtension> persistenceUnitBuilders;
 
@@ -150,13 +154,57 @@
         }
     };
 
+//    static {
+//        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EARConfigBuilder.class,
NameFactory.CONFIG_BUILDER);
+//        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+//        infoBuilder.addAttribute("transactionManagerAbstractName", AbstractNameQuery.class,
true);
+//        infoBuilder.addAttribute("connectionTrackerAbstractName", AbstractNameQuery.class,
true);
+//        infoBuilder.addAttribute("corbaGBeanAbstractName", AbstractNameQuery.class, true);
+//        infoBuilder.addAttribute("serverName", AbstractNameQuery.class, true);
+//
+//        infoBuilder.addReference("Repositories", Repository.class, "Repository");
+//        infoBuilder.addReference("EJBConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
+//        infoBuilder.addReference("WebConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
+//        infoBuilder.addReference("ConnectorConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
+//        infoBuilder.addReference("ActivationSpecInfoLocator", ActivationSpecInfoLocator.class,
NameFactory.MODULE_BUILDER);
+//        infoBuilder.addReference("AppClientConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
+//        infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
+//        infoBuilder.addReference("PersistenceUnitBuilders", ModuleBuilderExtension.class,
NameFactory.MODULE_BUILDER);
+//        infoBuilder.addReference("ArtifactResolvers", ArtifactResolver.class, "ArtifactResolver");
+//
+//        infoBuilder.addAttribute("kernel", Kernel.class, false);
+//
+//        infoBuilder.setConstructor(new String[]{
+//                "defaultEnvironment",
+//                "transactionManagerAbstractName",
+//                "connectionTrackerAbstractName",
+//                "corbaGBeanAbstractName",
+//                "serverName",
+//                "Repositories",
+//                "EJBConfigBuilder",
+//                "WebConfigBuilder",
+//                "ConnectorConfigBuilder",
+//                "ActivationSpecInfoLocator",
+//                "AppClientConfigBuilder",
+//                "ServiceBuilders",
+//                "PersistenceUnitBuilders",
+//                "ArtifactResolvers",
+//                "kernel"
+//        });
+//
+//    }
+
     public EARConfigBuilder(@ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment,
                             @ParamAttribute(name = "transactionManagerAbstractName") AbstractNameQuery
transactionManagerAbstractName,
                             @ParamAttribute(name = "connectionTrackerAbstractName") AbstractNameQuery
connectionTrackerAbstractName,
                             @ParamAttribute(name = "corbaGBeanAbstractName") AbstractNameQuery
corbaGBeanAbstractName,
                             @ParamAttribute(name = "serverName") AbstractNameQuery serverName,
                             @ParamReference(name = "Repositories", namingType = "Repository")Collection<?
extends Repository> repositories,
-                            @ParamReference(name = "ModuleBuilders", namingType = NameFactory.MODULE_BUILDER)Collection<ModuleBuilder>
moduleBuilders,
+                            @ParamReference(name = "EJBConfigBuilder", namingType = NameFactory.MODULE_BUILDER)Collection<ModuleBuilder>
ejbConfigBuilder,
+                            @ParamReference(name = "WebConfigBuilder", namingType = NameFactory.MODULE_BUILDER)Collection<ModuleBuilder>
webConfigBuilder,
+                            @ParamReference(name = "ConnectorConfigBuilder", namingType =
NameFactory.MODULE_BUILDER)Collection<ModuleBuilder> connectorConfigBuilder,
+                            @ParamReference(name = "ActivationSpecInfoLocator", namingType
= NameFactory.MODULE_BUILDER)Collection<ModuleBuilder> resourceReferenceBuilder,
+                            @ParamReference(name = "AppClientConfigBuilder", namingType =
NameFactory.MODULE_BUILDER)Collection<ModuleBuilder> appClientConfigBuilder,
                             @ParamReference(name = "ServiceBuilders", namingType = NameFactory.MODULE_BUILDER)Collection<NamespaceDrivenBuilder>
serviceBuilders,
                             @ParamReference(name = "PersistenceUnitBuilders", namingType
= NameFactory.MODULE_BUILDER)Collection<ModuleBuilderExtension> persistenceUnitBuilders,
                             @ParamReference(name = "ArtifactResolvers", namingType = "ArtifactResolver")Collection<?
extends ArtifactResolver> artifactResolvers,
@@ -169,7 +217,11 @@
                 serverName,
                 ConfigurationUtil.getConfigurationManager(kernel),
                 repositories,
-                moduleBuilders,
+                new SingleElementCollection<ModuleBuilder>(ejbConfigBuilder),
+                new SingleElementCollection<ModuleBuilder>(webConfigBuilder),
+                new SingleElementCollection<ModuleBuilder>(connectorConfigBuilder),
+                new SingleElementCollection<ModuleBuilder>(resourceReferenceBuilder),
+                new SingleElementCollection<ModuleBuilder>(appClientConfigBuilder),
                 serviceBuilders,
                 persistenceUnitBuilders,
                 kernel.getNaming(), artifactResolvers,
@@ -182,7 +234,11 @@
                             AbstractNameQuery corbaGBeanAbstractName,
                             AbstractNameQuery serverName,
                             Collection<? extends Repository> repositories,
-                            Collection<ModuleBuilder> moduleBuilders,
+                            ModuleBuilder ejbConfigBuilder,
+                            ModuleBuilder webConfigBuilder,
+                            ModuleBuilder connectorConfigBuilder,
+                            ActivationSpecInfoLocator activationSpecInfoLocator,
+                            ModuleBuilder appClientConfigBuilder,
                             NamespaceDrivenBuilder serviceBuilder,
                             ModuleBuilderExtension persistenceUnitBuilder,
                             Naming naming,
@@ -194,7 +250,11 @@
                 serverName,
                 null,
                 repositories,
-                moduleBuilders, 
+                new SingleElementCollection<ModuleBuilder>(ejbConfigBuilder),
+                new SingleElementCollection<ModuleBuilder>(webConfigBuilder),
+                new SingleElementCollection<ModuleBuilder>(connectorConfigBuilder),
+                new SingleElementCollection<ActivationSpecInfoLocator>(activationSpecInfoLocator),
+                new SingleElementCollection<ModuleBuilder>(appClientConfigBuilder),
                 serviceBuilder == null ? Collections.<NamespaceDrivenBuilder>emptySet()
: Collections.singleton(serviceBuilder),
                 persistenceUnitBuilder == null ? Collections.<ModuleBuilderExtension>emptySet()
: Collections.singleton(persistenceUnitBuilder),
                 naming,
@@ -209,7 +269,11 @@
                              AbstractNameQuery serverName,
                              ConfigurationManager configurationManager,
                              Collection<? extends Repository> repositories,
-                             Collection<ModuleBuilder> moduleBuilders, 
+                             SingleElementCollection ejbConfigBuilder,
+                             SingleElementCollection webConfigBuilder,
+                             SingleElementCollection connectorConfigBuilder,
+                             SingleElementCollection resourceReferenceBuilder,
+                             SingleElementCollection appClientConfigBuilder,
                              Collection<NamespaceDrivenBuilder> serviceBuilders,
                              Collection<ModuleBuilderExtension> persistenceUnitBuilders,
                              Naming naming,
@@ -219,7 +283,11 @@
         this.repositories = repositories;
         this.defaultEnvironment = defaultEnvironment;
 
-        this.moduleBuilders = moduleBuilders;
+        this.ejbConfigBuilder = ejbConfigBuilder;
+        this.resourceReferenceBuilder = resourceReferenceBuilder;
+        this.webConfigBuilder = webConfigBuilder;
+        this.connectorConfigBuilder = connectorConfigBuilder;
+        this.appClientConfigBuilder = appClientConfigBuilder;
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
         this.persistenceUnitBuilders = persistenceUnitBuilders;
 
@@ -247,21 +315,21 @@
     public AbstractNameQuery getCorbaGBeanName() {
         return corbaGBeanObjectName;
     }
-    
+
     private ModuleBuilder getEjbConfigBuilder() {
-        return getModuleBuilder(EJBModule.class);
+        return (ModuleBuilder) ejbConfigBuilder.getElement();
     }
-        
+
     private ModuleBuilder getWebConfigBuilder() {
-        return getModuleBuilder(WebModule.class);
+        return (ModuleBuilder) webConfigBuilder.getElement();
     }
-        
+
     private ModuleBuilder getConnectorConfigBuilder() {
-        return getModuleBuilder(ConnectorModule.class);
+        return (ModuleBuilder) connectorConfigBuilder.getElement();
     }
-        
+
     private ModuleBuilder getAppClientConfigBuilder() {
-        return getModuleBuilder(AppClientModule.class);
+        return (ModuleBuilder) appClientConfigBuilder.getElement();
     }
 
     public Object getDeploymentPlan(File planFile, JarFile jarFile, ModuleIDBuilder idBuilder)
throws DeploymentException {
@@ -279,13 +347,18 @@
 
         // get the modules either the application plan or for a stand alone module from the
specific deployer
         Module module = null;
-        for (ModuleBuilder moduleBuilder : getSortedModuleBuilders()) {
-            module = moduleBuilder.createModule(planFile, jarFile, naming, idBuilder);
-            if (module != null) {
-                break;
-            }
+        if (getWebConfigBuilder() != null) {
+            module = getWebConfigBuilder().createModule(planFile, jarFile, naming, idBuilder);
+        }
+        if (module == null && getEjbConfigBuilder() != null) {
+            module = getEjbConfigBuilder().createModule(planFile, jarFile, naming, idBuilder);
+        }
+        if (module == null && getConnectorConfigBuilder() != null) {
+            module = getConnectorConfigBuilder().createModule(planFile, jarFile, naming,
idBuilder);
+        }
+        if (module == null && getAppClientConfigBuilder() != null) {
+            module = getAppClientConfigBuilder().createModule(planFile, jarFile, naming,
idBuilder);
         }
-
         if (module == null) {
             return null;
         }
@@ -1063,45 +1136,29 @@
         return null;
     }
 
-    private List<ModuleBuilder> getSortedModuleBuilders() {
-        List<ModuleBuilder> list = new ArrayList<ModuleBuilder>(moduleBuilders);
-        Collections.sort(list, new ModuleBuilderComparator());
-        return list;        
-    }
-    
-    private static class ModuleBuilderComparator implements Comparator<ModuleBuilder>
{
-        public int compare(ModuleBuilder o1, ModuleBuilder o2) {
-            return o1.getPriority() - o2.getPriority();
-        }
-    }
-    
-    private ModuleBuilder getModuleBuilder(Class module) {
-        for (ModuleBuilder builder : moduleBuilders) {
-            if (builder.supportsModule(module)) {
-                return builder;
-            }
-        }
-        return null;
-    }
-    
     private ModuleBuilder getBuilder(Module module) throws DeploymentException {
-        ModuleBuilder builder = getModuleBuilder(module.getClass());
-        
-        if (builder == null) {
-            if (module instanceof EJBModule) {
+        if (module instanceof EJBModule) {
+            if (getEjbConfigBuilder() == null) {
                 throw new DeploymentException("Cannot deploy ejb application; No ejb deployer
defined: " + module.getModuleURI());
-            } else if (module instanceof WebModule) {
+            }
+            return getEjbConfigBuilder();
+        } else if (module instanceof WebModule) {
+            if (getWebConfigBuilder() == null) {
                 throw new DeploymentException("Cannot deploy web application; No war deployer
defined: " + module.getModuleURI());
-            } else if (module instanceof ConnectorModule) {
+            }
+            return getWebConfigBuilder();
+        } else if (module instanceof ConnectorModule) {
+            if (getConnectorConfigBuilder() == null) {
                 throw new DeploymentException("Cannot deploy resource adapter; No rar deployer
defined: " + module.getModuleURI());
-            } else if (module instanceof AppClientModule) {
+            }
+            return getConnectorConfigBuilder();
+        } else if (module instanceof AppClientModule) {
+            if (getAppClientConfigBuilder() == null) {
                 throw new DeploymentException("Cannot deploy app client; No app client deployer
defined: " + module.getModuleURI());
-            } else {
-                throw new DeploymentException("Cannot deploy application; No deployer for
module: " + module.getModuleURI());
             }
-        } 
-        
-        return builder;
+            return getAppClientConfigBuilder();
+        }
+        throw new IllegalArgumentException("Unknown module type: " + module.getClass().getName());
     }
 
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
Sun Dec  6 03:45:29 2009
@@ -33,9 +33,6 @@
  * @version $Rev:386276 $ $Date$
  */
 public interface ModuleBuilder {
-    
-    int NORMAL_PRIORITY = 50;
-    
     Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder)
throws DeploymentException;
 
     Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder
idBuilder) throws DeploymentException;
@@ -47,15 +44,4 @@
     void addGBeans(EARContext earContext, Module module, Bundle bundle, Collection repository)
throws DeploymentException;
 
     String getSchemaNamespace();
-    
-    /**
-     * Returns sort order priority.  Lower numbers indicate higher priority.
-     */
-    int getPriority();
-    
-    /**
-     * Returns true if this ModuleBuilder creates and installs module of the specified type.

-     *  
-     */
-    boolean supportsModule(Class moduleType);
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
Sun Dec  6 03:45:29 2009
@@ -50,14 +50,9 @@
 
     private final Map namespaceToBuilderMap = new HashMap();
 
-    private Class supportedModuleType;
-    private int priority = NORMAL_PRIORITY;
     private String defaultNamespace;
 
-    public SwitchingModuleBuilder(Collection builders, String supportedModule, int priority)
throws Exception {
-        this.supportedModuleType = SwitchingModuleBuilder.class.getClassLoader().loadClass(supportedModule);
-        this.priority = priority;
-        
+    public SwitchingModuleBuilder(Collection builders) {
         ReferenceCollection buildersCollection = (ReferenceCollection) builders;
         buildersCollection.addReferenceCollectionListener(new ReferenceCollectionListener()
{
             public void memberAdded(ReferenceCollectionEvent event) {
@@ -175,25 +170,15 @@
         return null;
     }
 
-    public int getPriority() {
-        return priority;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return supportedModuleType.isAssignableFrom(moduleType);
-    }
-    
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(SwitchingModuleBuilder.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("defaultNamespace", String.class, true, true);
-        infoBuilder.addAttribute("supportedModule", String.class, true, true);
-        infoBuilder.addAttribute("priority", int.class, true, true);
         infoBuilder.addReference("ModuleBuilders", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addInterface(ModuleBuilder.class);
 
-        infoBuilder.setConstructor(new String[] {"ModuleBuilders", "supportedModule","priority"});
+        infoBuilder.setConstructor(new String[] {"ModuleBuilders"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
Sun Dec  6 03:45:29 2009
@@ -16,10 +16,8 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.HashSet;
@@ -74,6 +72,10 @@
     
     protected static MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
     
+    protected static ActivationSpecInfoLocator activationSpecInfoLocator = connectorConfigBuilder;
+    
+    protected static ModuleBuilder appClientConfigBuilder = null;
+    
     protected final static ModuleIDBuilder idBuilder = new ModuleIDBuilder();
     
     protected static final NamespaceDrivenBuilder securityBuilder = null;
@@ -104,6 +106,7 @@
     
     protected static final AbstractName raModuleName = naming.createChildName(earName, "rar",
NameFactory.RESOURCE_ADAPTER_MODULE);
 
+
     protected Map<String, Artifact> locations = new HashMap<String, Artifact>();
 
     protected Environment defaultParentId;
@@ -133,14 +136,6 @@
         defaultParentId.addDependency(new Artifact("org.apache.geronimo.tests", "test", "1",
"car"), ImportType.ALL);
     }
 
-    private List<ModuleBuilder> getBuilders(ModuleBuilder...builders) {
-        List<ModuleBuilder> b = new ArrayList<ModuleBuilder>();
-        for (ModuleBuilder builder : builders) {
-            b.add(builder);
-        }
-        return b;
-    }
-    
     public void testBuildConfiguration() throws Exception {
         ConfigurationData configurationData = null;
         DeploymentContext context = null;
@@ -151,9 +146,11 @@
                     corbaGBeanAbstractNameQuery,
                     null,
                     Collections.singleton(repository),
-                    getBuilders(ejbConfigBuilder,
-                                webConfigBuilder,
-                                connectorConfigBuilder),              
+                    ejbConfigBuilder,
+                    webConfigBuilder,
+                    connectorConfigBuilder,
+                    activationSpecInfoLocator,
+                    appClientConfigBuilder,
                     serviceBuilder,
                     persistenceUnitBuilder,
                     naming,
@@ -180,9 +177,11 @@
                 corbaGBeanAbstractNameQuery,
                 null,
                 null,
-                getBuilders(ejbConfigBuilder,
-                            webConfigBuilder,
-                            connectorConfigBuilder),
+                ejbConfigBuilder,
+                webConfigBuilder,
+                connectorConfigBuilder,
+                activationSpecInfoLocator,
+                appClientConfigBuilder,
                 serviceBuilder,
                 persistenceUnitBuilder,
                 naming, artifactResolvers, bundleContext);
@@ -213,9 +212,11 @@
                 corbaGBeanAbstractNameQuery,
                 null,
                 null,
-                getBuilders(ejbConfigBuilder,
-                            webConfigBuilder,
-                            connectorConfigBuilder),
+                ejbConfigBuilder,
+                webConfigBuilder,
+                connectorConfigBuilder,
+                activationSpecInfoLocator,
+                appClientConfigBuilder,
                 serviceBuilder,
                 persistenceUnitBuilder,
                 naming, artifactResolvers, bundleContext);
@@ -246,9 +247,11 @@
                 corbaGBeanAbstractNameQuery,
                 null,
                 null,
-                getBuilders(ejbConfigBuilder,
-                            webConfigBuilder,
-                            connectorConfigBuilder),
+                ejbConfigBuilder,
+                webConfigBuilder,
+                connectorConfigBuilder,
+                activationSpecInfoLocator,
+                appClientConfigBuilder,
                 serviceBuilder,
                 persistenceUnitBuilder,
                 naming, artifactResolvers, bundleContext);
@@ -279,9 +282,11 @@
                 corbaGBeanAbstractNameQuery,
                 null,
                 null,
-                getBuilders(ejbConfigBuilder,
-                            webConfigBuilder,
-                            connectorConfigBuilder),
+                ejbConfigBuilder,
+                webConfigBuilder,
+                connectorConfigBuilder,
+                activationSpecInfoLocator,
+                appClientConfigBuilder,
                 serviceBuilder,
                 persistenceUnitBuilder,
                 naming, artifactResolvers, bundleContext);
@@ -312,8 +317,11 @@
                 corbaGBeanAbstractNameQuery,
                 null,
                 null,
-                getBuilders(webConfigBuilder,
-                            connectorConfigBuilder),
+                null,
+                webConfigBuilder,
+                connectorConfigBuilder,
+                activationSpecInfoLocator,
+                appClientConfigBuilder,
                 serviceBuilder,
                 persistenceUnitBuilder,
                 naming, artifactResolvers, bundleContext);
@@ -345,8 +353,11 @@
                 corbaGBeanAbstractNameQuery,
                 null,
                 null,
-                getBuilders(ejbConfigBuilder,
-                            connectorConfigBuilder),
+                ejbConfigBuilder,
+                null,
+                connectorConfigBuilder,
+                activationSpecInfoLocator,
+                appClientConfigBuilder,
                 serviceBuilder,
                 persistenceUnitBuilder,
                 naming, artifactResolvers, bundleContext);
@@ -377,8 +388,11 @@
                 corbaGBeanAbstractNameQuery,
                 null,
                 null,
-                getBuilders(ejbConfigBuilder,
-                             webConfigBuilder),
+                ejbConfigBuilder,
+                webConfigBuilder,
+                null,
+                activationSpecInfoLocator,
+                appClientConfigBuilder,
                 serviceBuilder,
                 persistenceUnitBuilder,
                 naming, artifactResolvers, bundleContext);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
Sun Dec  6 03:45:29 2009
@@ -114,12 +114,4 @@
     public GBeanData locateConnectionFactoryInfo(GBeanData resourceAdapterModuleData, String
connectionFactoryInterfaceName) throws DeploymentException {
         return null;
     }
-
-    public int getPriority() {
-        return NORMAL_PRIORITY;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return ConnectorModule.class.isAssignableFrom(moduleType);
-    }
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
Sun Dec  6 03:45:29 2009
@@ -83,12 +83,4 @@
         return null;
     }
 
-    public int getPriority() {
-        return NORMAL_PRIORITY;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return EJBModule.class.isAssignableFrom(moduleType);
-    }
-
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
Sun Dec  6 03:45:29 2009
@@ -88,12 +88,4 @@
         return null;
     }
 
-    public int getPriority() {
-        return NORMAL_PRIORITY;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return WebModule.class.isAssignableFrom(moduleType);
-    }
-
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Sun Dec  6 03:45:29 2009
@@ -747,14 +747,6 @@
         webModuleData.setReferencePattern("TrackedConnectionAssociator", moduleContext.getConnectionTrackerName());
     }
 
-    public int getPriority() {
-        return 10;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return WebModule.class.isAssignableFrom(moduleType);
-    }
-    
     private static class InternWrapper implements XMLStreamReader {
         private final XMLStreamReader delegate;
 

Modified: geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/plan/plan.xml?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/plan/plan.xml Sun Dec  6 03:45:29
2009
@@ -28,6 +28,9 @@
         <reference name="Repositories">
             <!--<gbean-name>*:name=Repository,*</gbean-name>-->
         </reference>
+        <reference name="WebConfigBuilder">
+            <name>WebBuilder</name>
+        </reference>
         <references name="ServiceBuilders">
             <pattern>
                 <name>GBeanBuilder</name>
@@ -41,21 +44,23 @@
                 <name>PersistenceUnitBuilder</name>
             </pattern>
         </references>
-        <references name="ModuleBuilders">
-            <pattern>
-                <name>WebBuilder</name>
-            </pattern>
+        <references name="EJBConfigBuilder">
             <pattern>
                 <name>EJBBuilder</name>
             </pattern>
             <pattern>
-                <name>ConnectorBuilder</name>
+                <name>UnavailableEJBBuilder</name>
             </pattern>
+        </references>
+        <reference name="ConnectorConfigBuilder">
+            <name>ConnectorBuilder</name>
+        </reference>
+        <references name="AppClientConfigBuilder">
             <pattern>
                 <name>AppClientBuilder</name>
             </pattern>
             <pattern>
-                <name>AriesAppBuilder</name>
+                <name>UnavailableAppClientBuilder</name>
             </pattern>
         </references>
         <reference name="ArtifactResolvers">
@@ -77,8 +82,6 @@
     <!-- web switching builder -->
     <gbean name="WebBuilder" class="org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder">
         <attribute name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-${geronimoSchemaVersion}</attribute>
-        <attribute name="supportedModule">org.apache.geronimo.j2ee.deployment.WebModule</attribute>
-        <attribute name="priority">10</attribute>
         <references name="ModuleBuilders">
             <pattern>
                 <name>JettyWebBuilder</name>

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=887632&r1=887631&r2=887632&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Sun Dec  6 03:45:29 2009
@@ -898,14 +898,6 @@
         return new AbstractNameQuery(artifact, nameMap, (Set) null);
     }
 
-    public int getPriority() {
-        return 20;
-    }
-    
-    public boolean supportsModule(Class moduleType) {
-        return EjbModule.class.isAssignableFrom(moduleType);
-    }
-    
     public static class EarData {
         private final Map<String, EjbModule> ejbModules = new TreeMap<String, EjbModule>();
         private final Map<String, EjbJarInfo> ejbJars = new TreeMap<String, EjbJarInfo>();



Mime
View raw message