geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1302962 - in /geronimo/server/branches/3.0-beta/framework/modules: geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ geronimo-system/src/main/java/org/apache/geronimo/system/main/
Date Tue, 20 Mar 2012 16:05:40 GMT
Author: gawor
Date: Tue Mar 20 16:05:39 2012
New Revision: 1302962

URL: http://svn.apache.org/viewvc?rev=1302962&view=rev
Log:
GERONIMODEVTOOLS-790: Manage server application start - load but don't start certain modules

Modified:
    geronimo/server/branches/3.0-beta/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
    geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java

Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java?rev=1302962&r1=1302961&r2=1302962&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
(original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/ExtendedDeploymentManager.java
Tue Mar 20 16:05:39 2012
@@ -314,15 +314,20 @@ public abstract class ExtendedDeployment
         return (Boolean) kernel.invoke(applicationGBeanName, "hotSwapApplicationContent",
arguments, argumentTypes);
     }
     
+    /**
+     * Returns application gbean name for the specified configuration id of the OSGi application.
+     * Returns null if no such gbean exists.
+     */
     public AbstractName getApplicationGBeanName(Artifact configurationId) {
         Set<AbstractName> applicationGBeanNames = kernel.listGBeans(new AbstractNameQuery(configurationId,
Collections.EMPTY_MAP, "org.apache.geronimo.aries.ApplicationGBean"));
-        if (applicationGBeanNames.size()!=1){
+        if (applicationGBeanNames == null || applicationGBeanNames.isEmpty()) {
+            return null;
+        } else if (applicationGBeanNames.size() > 1) {
             throw new IllegalStateException("An EBA should have one and only one ApplicationGean
object");
         }
         return applicationGBeanNames.iterator().next();
     }
     
-    
     /**
      * Get the BundleRecorderGBean
      * @return

Modified: geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java?rev=1302962&r1=1302961&r2=1302962&view=diff
==============================================================================
--- geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
(original)
+++ geronimo/server/branches/3.0-beta/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
Tue Mar 20 16:05:39 2012
@@ -21,6 +21,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Properties;
@@ -155,6 +156,21 @@ public class EmbeddedDaemon implements M
         }
     }
 
+    private Set<Artifact> getLoadOnlyConfigList() {
+        String list = System.getProperty("geronimo.loadOnlyConfigList");
+        Set<Artifact> artifacts = new HashSet<Artifact>();
+        if (list != null) {
+            for (String name : list.split("\\s*,\\s*")) {
+                try {
+                    artifacts.add(Artifact.create(name));
+                } catch (Exception e) {
+                    System.err.println("Error parsing configuration name [" + name + "]:
" + e.getMessage());
+                }
+            }
+        }
+        return artifacts;
+    }
+
     protected void initializeMonitor(DaemonCLParser parser) {
         if (parser.isVerboseInfo() || parser.isVerboseDebug() || parser.isVerboseTrace()
|| parser.isNoProgress()) {
             monitor = new SilentStartupMonitor();
@@ -167,7 +183,7 @@ public class EmbeddedDaemon implements M
         }
         lifecycleMonitor = new DebugLoggingLifecycleMonitor(log);
     }
-
+    
     protected int doStartup() {
         try {            
             int exitCode = initializeKernel();
@@ -196,6 +212,8 @@ public class EmbeddedDaemon implements M
 
             monitor.foundModules(configs.toArray(new Artifact[configs.size()]));
 
+            Set<Artifact> loadOnlyConfigs = getLoadOnlyConfigList();
+            
             // load the rest of the configurations
             try {
                 ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
@@ -211,7 +229,9 @@ public class EmbeddedDaemon implements M
                             unloadedConfigs.remove(configID);
                             monitor.moduleLoaded(configID);
                             monitor.moduleStarting(configID);
-                            configurationManager.startConfiguration(configID, lifecycleMonitor);
+                            if (!loadOnlyConfigs.contains(configID)) {
+                                configurationManager.startConfiguration(configID, lifecycleMonitor);
+                            }
                             monitor.moduleStarted(configID);
                         }
                     } while (unloadedConfigsCount > unloadedConfigs.size());
@@ -276,7 +296,7 @@ public class EmbeddedDaemon implements M
                 try {
                     b.start(Bundle.START_TRANSIENT);
                 } catch (BundleException e) {
-                    log.warn("Bundle: " + bundle.getBundleId() + "can not start" + e.getMessage());
+                    log.warn("Bundle " + bundle.getBundleId() + " failed to start: " + e.getMessage());
                 }
             }
         }



Mime
View raw message