geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1370400 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core: GeronimoLaunchConfigurationDelegate.java GeronimoServerDelegate.java
Date Tue, 07 Aug 2012 17:54:50 GMT
Author: gawor
Date: Tue Aug  7 17:54:50 2012
New Revision: 1370400

URL: http://svn.apache.org/viewvc?rev=1370400&view=rev
Log:
GERONIMODEVTOOLS-791: Delete module when server is stopped - enable by default now

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoLaunchConfigurationDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoLaunchConfigurationDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoLaunchConfigurationDelegate.java?rev=1370400&r1=1370399&r2=1370400&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoLaunchConfigurationDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoLaunchConfigurationDelegate.java
Tue Aug  7 17:54:50 2012
@@ -18,6 +18,7 @@ package org.apache.geronimo.st.v30.core;
 
 import java.io.File;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -137,30 +138,37 @@ public class GeronimoLaunchConfiguration
     private String[] updateJVMArguments(String[] jvmArguments, GeronimoServerBehaviourDelegate
server) {
         boolean managedApplicationStart = server.getServerDelegate().isManageApplicationStart();
       
         Trace.trace(Trace.INFO, "GeronimoLaunchConfigurationDelegate: manageApplicationStart:="
+ managedApplicationStart, Activator.traceCore);
+        
+        int params = 0;
+        Set<String> deletedConfigs = server.getDeletedConfigIds();
+        if (!deletedConfigs.isEmpty()) {
+            params++;
+        } 
+        
+        Set<String> modifiedConfigs = null;        
         if (managedApplicationStart) {
-            Set<String> modifiedConfigs = server.getModifiedConfigIds();
-            Set<String> deletedConfigs = server.getDeletedConfigIds();
-            int params = 0;
+            modifiedConfigs = server.getModifiedConfigIds();
             if (!modifiedConfigs.isEmpty()) {
                 params++;
             }
+        } else {
+            modifiedConfigs = Collections.emptySet();
+        }
+        
+        if (params > 0) {
+            String[] newJvmArguments = new String[jvmArguments.length + params];
+            System.arraycopy(jvmArguments, 0, newJvmArguments, 0, jvmArguments.length);
+            int index = jvmArguments.length;
+            if (!modifiedConfigs.isEmpty()) {
+                newJvmArguments[index] = toString("-Dgeronimo.loadOnlyConfigList=", modifiedConfigs);
+                index++;
+            }
             if (!deletedConfigs.isEmpty()) {
-                params++;
-            }            
-            if (params > 0) {
-                String[] newJvmArguments = new String[jvmArguments.length + params];
-                System.arraycopy(jvmArguments, 0, newJvmArguments, 0, jvmArguments.length);
-                int index = jvmArguments.length;
-                if (!modifiedConfigs.isEmpty()) {
-                    newJvmArguments[index] = toString("-Dgeronimo.loadOnlyConfigList=", modifiedConfigs);
-                    index++;
-                }
-                if (!deletedConfigs.isEmpty()) {
-                    newJvmArguments[index] = toString("-Dgeronimo.removedArtifactList=",
deletedConfigs);
-                }
-                return newJvmArguments;
+                newJvmArguments[index] = toString("-Dgeronimo.removedArtifactList=", deletedConfigs);
             }
+            jvmArguments = newJvmArguments;
         }
+        
         return jvmArguments;
     }
     

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java?rev=1370400&r1=1370399&r2=1370400&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
Tue Aug  7 17:54:50 2012
@@ -38,6 +38,7 @@ import javax.enterprise.deploy.spi.facto
 import org.apache.geronimo.crypto.EncryptionManager;
 import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
 import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager;
+import org.apache.geronimo.st.v30.core.internal.RemovedModuleHelper;
 import org.apache.geronimo.st.v30.core.internal.Trace;
 import org.apache.geronimo.st.v30.core.osgi.AriesHelper;
 import org.apache.geronimo.st.v30.core.osgi.OsgiConstants;
@@ -254,16 +255,16 @@ public class GeronimoServerDelegate exte
      */
     public void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor)
throws CoreException {
         Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.modifyModules",
add, remove, monitor);
-        // Now, only handle the remov/add modules when the server is shutdown 
-        // and the attribute org.apache.geronimo.st.v30.core.manageApplicationStart is true
-        int serverState = getServer().getServerState();
-        if (serverState == IServer.STATE_STOPPED && isManageApplicationStart()) {
-            GeronimoServerBehaviourDelegate delegate = (GeronimoServerBehaviourDelegate)
getServer().loadAdapter(GeronimoServerBehaviourDelegate.class, monitor);
+        // Handle remove/add modules when the server is shutdown 
+        IServer server = getServer();
+        if (server != null && server.getServerState() == IServer.STATE_STOPPED) {
+            GeronimoServerBehaviourDelegate delegate = (GeronimoServerBehaviourDelegate)
server.loadAdapter(GeronimoServerBehaviourDelegate.class, monitor);
+            RemovedModuleHelper removedModuleHelper = delegate.getRemovedModuleHelper();
             if (remove != null && remove.length > 0) {
-                delegate.getRemovedModuleHelper().markRemoveModules(remove, monitor);
+                removedModuleHelper.markRemoveModules(remove, monitor);
             } 
             if (add != null && add.length > 0) {
-                delegate.getRemovedModuleHelper().unMarkRemoveModules(add, monitor);
+                removedModuleHelper.unMarkRemoveModules(add, monitor);
             }
         }
         // TODO servermodule.info should be pushed to here and set as instance



Mime
View raw message