geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1102407 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core: GeronimoServerBehaviourDelegate.java SynchronizeProjectOnServerTask.java
Date Thu, 12 May 2011 18:22:16 GMT
Author: gawor
Date: Thu May 12 18:22:15 2011
New Revision: 1102407

URL: http://svn.apache.org/viewvc?rev=1102407&view=rev
Log:
GERONIMODEVTOOLS-746: Set module state to stopped once server is stopped.

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

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.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/GeronimoServerBehaviourDelegate.java?rev=1102407&r1=1102406&r2=1102407&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
Thu May 12 18:22:15 2011
@@ -624,6 +624,7 @@ abstract public class GeronimoServerBeha
 
     public void setServerStopped() {
         setServerState(IServer.STATE_STOPPED);
+        resetModuleState();
     }
 
     public IGeronimoServer getGeronimoServer() {
@@ -656,7 +657,6 @@ abstract public class GeronimoServerBeha
         Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.terminate");
     }
 
-
     protected void stopImpl() {
         if (process != null) {
             process = null;
@@ -664,8 +664,21 @@ abstract public class GeronimoServerBeha
             processListener = null;
         }
         setServerState(IServer.STATE_STOPPED);
+        resetModuleState();
     }
 
+    private void resetModuleState() {
+        Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.resetModuleState");
+
+        IModule[] modules = getServer().getModules();
+        for (int i = 0; i < modules.length; i++) {
+            IModule[] module = new IModule[] { modules[i] };
+            setModuleState(module, IServer.STATE_STOPPED);
+        }        
+
+        Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.resetModuleState");
+    }
+    
     protected void invokeCommand(int deltaKind, IModule module, IProgressMonitor monitor)
throws CoreException {
         Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.invokeCommand", deltaKindToString(deltaKind),
module.getName());
         
@@ -1175,7 +1188,7 @@ abstract public class GeronimoServerBeha
         Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.startUpdateServerStateTask",
getServer().getName());
 
         stateTimer = new Timer(true);
-        stateTimer.schedule(new UpdateServerStateTask(this, getServer()), TIMER_TASK_DELAY
* 1000, TIMER_TASK_INTERVAL * 1000);
+        stateTimer.schedule(new UpdateServerStateTask(this, getServer()), 0, TIMER_TASK_INTERVAL
* 1000);
 
         Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.startUpdateServerStateTask");
     }
@@ -1188,7 +1201,7 @@ abstract public class GeronimoServerBeha
         }
         
         synchronizerTimer = new Timer(true);
-        synchronizerTimer.schedule(new SynchronizeProjectOnServerTask(this, getServer()),
TIMER_TASK_DELAY * 1000, TIMER_TASK_INTERVAL * 1000);
+        synchronizerTimer.schedule(new SynchronizeProjectOnServerTask(this, getServer()),
0, TIMER_TASK_INTERVAL * 1000);
         
         Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.startSynchronizeProjectOnServerTask");
     }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/SynchronizeProjectOnServerTask.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/SynchronizeProjectOnServerTask.java?rev=1102407&r1=1102406&r2=1102407&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/SynchronizeProjectOnServerTask.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/SynchronizeProjectOnServerTask.java
Thu May 12 18:22:15 2011
@@ -127,7 +127,7 @@ public class SynchronizeProjectOnServerT
             }
         }
         
-        Trace.tracePoint("Exist ", "SynchronizeProjectOnServerTask.run");
+        Trace.tracePoint("Exit ", "SynchronizeProjectOnServerTask.run");
     }
 
     private void setModuleState(IModule[] modules, int state) {
@@ -172,17 +172,12 @@ public class SynchronizeProjectOnServerT
             Trace.trace(Trace.WARNING, "Could not remove module in SynchronizeProjectOnServerTask",
e);
         }
         
-        Trace.tracePoint("Exist ", "SynchronizeProjectOnServerTask.removeModules");
+        Trace.tracePoint("Exit ", "SynchronizeProjectOnServerTask.removeModules");
     }
     
     private boolean canUpdateState() {
-        
-        Trace.tracePoint("Entry ", "SynchronizeProjectOnServerTask.canUpdateState");
-        
-        boolean flag = true;
-        
-        if (server.getServerState()!=IServer.STATE_STARTED) {
-            flag = false;            
+        if (server.getServerState() != IServer.STATE_STARTED) {
+            return false;
         }
 
         IGeronimoServer thisServer = (IGeronimoServer) this.server.loadAdapter(IGeronimoServer.class,
null);
@@ -195,14 +190,13 @@ public class SynchronizeProjectOnServerT
                     if (!isSameRuntimeLocation(server) && server.getServerState()
!= IServer.STATE_STOPPED) {
                         Trace.trace(Trace.WARNING, server.getId()
                                 + " Cannot update server state.  URL conflict between multiple
servers.");
-                        flag = false;
+                        return false;
                     }
                 }
             }
         }
         
-        Trace.tracePoint("Exist ", "SynchronizeProjectOnServerTask.canUpdateState", flag);
     
-        return flag;
+        return true;
     }
 
     private boolean isSameRuntimeLocation(IServer server) {



Mime
View raw message