tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1291687 - in /openejb/trunk/openejb: container/openejb-core/src/main/java/org/apache/openejb/assembler/ container/openejb-core/src/main/java/org/apache/openejb/config/ itests/failover-ejb/ tomee/tomee-catalina/src/main/java/org/apache/tome...
Date Tue, 21 Feb 2012 10:12:17 GMT
Author: rmannibucau
Date: Tue Feb 21 10:12:16 2012
New Revision: 1291687

URL: http://svn.apache.org/viewvc?rev=1291687&view=rev
Log:
removing PreconfiguredFactory which will be useless (and never worked completly) when scan.xml
will be managed

Removed:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/PreconfiguredFactory.java
    openejb/trunk/openejb/itests/failover-ejb/failover-ejb.iml
Modified:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
    openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java?rev=1291687&r1=1291686&r2=1291687&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
Tue Feb 21 10:12:16 2012
@@ -26,7 +26,6 @@ import org.apache.openejb.config.AppModu
 import org.apache.openejb.config.ConfigurationFactory;
 import org.apache.openejb.config.DeploymentLoader;
 import org.apache.openejb.config.DeploymentModule;
-import org.apache.openejb.config.PreconfiguredFactory;
 import org.apache.openejb.config.sys.AdditionalDeployments;
 import org.apache.openejb.config.sys.Deployments;
 import org.apache.openejb.config.sys.JaxbOpenejb;
@@ -117,55 +116,53 @@ public class DeployerEjb implements Depl
 
         final File file = new File(realLocation(rawLocation));
 
-        AppInfo appInfo = PreconfiguredFactory.configureApplication(file);
+        AppInfo appInfo;
 
         try {
-            if (appInfo == null) { // using app-info.xml we ignore alt-dd
-                appModule = deploymentLoader.load(file);
+            appModule = deploymentLoader.load(file);
 
-                // Add any alternate deployment descriptors to the modules
-                Map<String, DeploymentModule> modules = new TreeMap<String, DeploymentModule>();
-                for (DeploymentModule module : appModule.getEjbModules()) {
-                    modules.put(module.getModuleId(), module);
-                }
-                for (DeploymentModule module : appModule.getClientModules()) {
-                    modules.put(module.getModuleId(), module);
-                }
-                for (DeploymentModule module : appModule.getWebModules()) {
-                    modules.put(module.getModuleId(), module);
-                }
-                for (DeploymentModule module : appModule.getConnectorModules()) {
-                    modules.put(module.getModuleId(), module);
-                }
+            // Add any alternate deployment descriptors to the modules
+            Map<String, DeploymentModule> modules = new TreeMap<String, DeploymentModule>();
+            for (DeploymentModule module : appModule.getEjbModules()) {
+                modules.put(module.getModuleId(), module);
+            }
+            for (DeploymentModule module : appModule.getClientModules()) {
+                modules.put(module.getModuleId(), module);
+            }
+            for (DeploymentModule module : appModule.getWebModules()) {
+                modules.put(module.getModuleId(), module);
+            }
+            for (DeploymentModule module : appModule.getConnectorModules()) {
+                modules.put(module.getModuleId(), module);
+            }
+
+            for (Map.Entry<Object, Object> entry : properties.entrySet()) {
+                String name = (String) entry.getKey();
+                if (name.startsWith(ALT_DD + "/")) {
+                    name = name.substring(ALT_DD.length() + 1);
+
+                    DeploymentModule module;
+                    int slash = name.indexOf('/');
+                    if (slash > 0) {
+                        String moduleId = name.substring(0, slash);
+                        name = name.substring(slash + 1);
+                        module = modules.get(moduleId);
+                    } else {
+                        module = appModule;
+                    }
 
-                for (Map.Entry<Object, Object> entry : properties.entrySet()) {
-                    String name = (String) entry.getKey();
-                    if (name.startsWith(ALT_DD + "/")) {
-                        name = name.substring(ALT_DD.length() + 1);
-
-                        DeploymentModule module;
-                        int slash = name.indexOf('/');
-                        if (slash > 0) {
-                            String moduleId = name.substring(0, slash);
-                            name = name.substring(slash + 1);
-                            module = modules.get(moduleId);
+                    if (module != null) {
+                        String value = (String) entry.getValue();
+                        File dd = new File(value);
+                        if (dd.canRead()) {
+                            module.getAltDDs().put(name, dd.toURI().toURL());
                         } else {
-                            module = appModule;
-                        }
-
-                        if (module != null) {
-                            String value = (String) entry.getValue();
-                            File dd = new File(value);
-                            if (dd.canRead()) {
-                                module.getAltDDs().put(name, dd.toURI().toURL());
-                            } else {
-                                module.getAltDDs().put(name, value);
-                            }
+                            module.getAltDDs().put(name, value);
                         }
                     }
                 }
-                appInfo = configurationFactory.configureApplication(appModule);
             }
+            appInfo = configurationFactory.configureApplication(appModule);
 
             if (properties != null && properties.containsKey(OPENEJB_DEPLOYER_FORCED_APP_ID_PROP))
{
                 appInfo.appId = properties.getProperty(OPENEJB_DEPLOYER_FORCED_APP_ID_PROP);

Modified: openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java?rev=1291687&r1=1291686&r2=1291687&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
Tue Feb 21 10:12:16 2012
@@ -56,7 +56,6 @@ import org.apache.openejb.assembler.clas
 import org.apache.openejb.config.AppModule;
 import org.apache.openejb.config.ConfigurationFactory;
 import org.apache.openejb.config.DeploymentLoader;
-import org.apache.openejb.config.PreconfiguredFactory;
 import org.apache.openejb.config.WebModule;
 import org.apache.openejb.core.CoreContainerSystem;
 import org.apache.openejb.core.WebContext;
@@ -946,39 +945,26 @@ public class TomcatWebAppBuilder impleme
                     continue;
                 }
 
-                AppInfo appInfo = null;
+                AppInfo appInfo;
                 try {
-                    appInfo = PreconfiguredFactory.configureApplication(file);
-                } catch (OpenEJBException e) {
-                    logger.warning("Failed to load META-INF/app-info.xml " + file.getAbsolutePath(),
e);
-                }
-
-                try {
-                    AppModule appModule = null;
-                    if (appInfo == null) {
-                        file = file.getCanonicalFile().getAbsoluteFile();
-                        appModule = deploymentLoader.load(file);
-
-                        // Ignore any standalone web modules - this happens when the app
is unpaked and doesn't have a WEB-INF dir
-                        if (appModule.getDeploymentModule().size() == 1 && appModule.getWebModules().size()
== 1) {
-                            WebModule webModule = appModule.getWebModules().iterator().next();
-                            if (file.getAbsolutePath().equals(webModule.getJarLocation()))
{
-                                continue;
-                            }
-                        }
+                    file = file.getCanonicalFile().getAbsoluteFile();
+                    AppModule appModule = deploymentLoader.load(file);
 
-                        // tell web modules to deploy using this host
-                        for (WebModule webModule : appModule.getWebModules()) {
-                            webModule.setHost(standardHost.getName());
+                    // Ignore any standalone web modules - this happens when the app is unpaked
and doesn't have a WEB-INF dir
+                    if (appModule.getDeploymentModule().size() == 1 && appModule.getWebModules().size()
== 1) {
+                        WebModule webModule = appModule.getWebModules().iterator().next();
+                        if (file.getAbsolutePath().equals(webModule.getJarLocation())) {
+                            continue;
                         }
+                    }
 
-                        appInfo = configurationFactory.configureApplication(appModule);
-                    } else {
-                        for (WebAppInfo webAppInfo : appInfo.webApps) {
-                            webAppInfo.host = standardHost.getName();
-                        }
+                    // tell web modules to deploy using this host
+                    for (WebModule webModule : appModule.getWebModules()) {
+                        webModule.setHost(standardHost.getName());
                     }
 
+                    appInfo = configurationFactory.configureApplication(appModule);
+
                     // if this is an unpacked dir, tomcat will pick it up as a webapp so
undeploy it first
                     if (file.isDirectory()) {
                         ContainerBase context = (ContainerBase) standardHost.findChild("/"
+ name);



Mime
View raw message