geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1073584 - /geronimo/server/branches/3.0-M2/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
Date Wed, 23 Feb 2011 03:33:45 GMT
Author: gawor
Date: Wed Feb 23 03:33:45 2011
New Revision: 1073584

URL: http://svn.apache.org/viewvc?rev=1073584&view=rev
Log:
GERONIMO-5765: Display a warning message when application with OSGi manifest is deployed -
move the code to execute a little bit later

Modified:
    geronimo/server/branches/3.0-M2/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java

Modified: geronimo/server/branches/3.0-M2/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-M2/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java?rev=1073584&r1=1073583&r2=1073584&view=diff
==============================================================================
--- geronimo/server/branches/3.0-M2/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/server/branches/3.0-M2/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
Wed Feb 23 03:33:45 2011
@@ -111,29 +111,6 @@ public class Deployer implements GBeanLi
         File originalModuleFile = moduleFile;
         File tmpDir = null;
         if (moduleFile != null && !moduleFile.isDirectory()) {
-            
-            // GERONIMO-5765 add a warning message if user is deploying a bundle(wab)
-            // In future, we will support bundle deployment through deployer and remove this,
see GERONIMO-5764
-            JarFile moduleJar = null;
-            try {
-                moduleJar = new JarFile(moduleFile);
-                Manifest mf = moduleJar.getManifest();
-                if (mf!=null && mf.getMainAttributes().getValue("Bundle-SymbolicName")!=
null){
-                    log.warn("Deploying module as a regular Java EE application. Its existing
OSGi manifest will be ignored.");
-                } 
-            } catch (IOException ioe) {
-                ioe.printStackTrace();
-            } finally {
-                if (moduleJar!=null){
-                    try {
-                        moduleJar.close();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-            
-            
             // todo jar url handling with Sun's VM on Windows leaves a lock on the module
file preventing rebuilds
             // to address this we use a gross hack and copy the file to a temporary directory
             // the lock on the file will prevent that being deleted properly until the URLJarFile
has
@@ -265,6 +242,14 @@ public class Deployer implements GBeanLi
                         (moduleFile == null ? "" : (planFile == null ? "" : ", ") + "moduleFile="
+ moduleFile.getAbsolutePath()) + ")");
             }
 
+
+            if (module != null) {
+                Manifest mf = module.getManifest();
+                if (mf != null && mf.getMainAttributes().getValue("Bundle-SymbolicName")
!= null) {
+                    log.warn("Application module contains OSGi manifest. The OSGi manifest
will be ignored and the application will be deployed as a regular Java EE application.");
+                }
+            }
+
             Artifact configID = getConfigID(module, idBuilder, plan, builder);
 
             ConfigurationStore store = getConfigurationStore(targetConfigurationStore);



Mime
View raw message