geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r446707 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
Date Fri, 15 Sep 2006 19:57:57 GMT
Author: sppatel
Date: Fri Sep 15 12:57:56 2006
New Revision: 446707

URL: http://svn.apache.org/viewvc?view=rev&rev=446707
Log:
fix, if module undeployed or stopped outside of eclipse, eclipse deployment gets out of sync
and scenario ignored.

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

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java?view=diff&rev=446707&r1=446706&r2=446707
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
Fri Sep 15 12:57:56 2006
@@ -190,16 +190,17 @@
 	 */
 	public void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor)
throws CoreException {
 
-		Trace.trace(Trace.INFO, ">> publishModule(), deltaKind = " + deltaKind);
+		Trace.trace(Trace.INFO, ">> publishModule(), deltaKind = " + deltaKindToString(deltaKind));
 		Trace.trace(Trace.INFO, Arrays.asList(module).toString());
 		_monitor = monitor;
 
-		if (module.length == 1 && (deltaKind == ADDED || deltaKind == REMOVED)) {
+		//NO_CHANGE need if app is associated but not started and no delta
+		if (module.length == 1 && (deltaKind == ADDED || deltaKind == REMOVED || deltaKind
== NO_CHANGE)) {
 			invokeCommand(deltaKind, module[0]);
 		} else if (deltaKind == CHANGED) {
 			// TODO This case is flawed due to WTP Bugzilla 123676
 			invokeCommand(deltaKind, module[0]);
-		}
+		} 
 
 		setModulePublishState(module, IServer.PUBLISH_STATE_NONE);
 
@@ -310,6 +311,10 @@
 				doUndeploy(module);
 				break;
 			}
+			case NO_CHANGE: {
+				doNoChange(module);
+				break;
+			}
 			default:
 				throw new IllegalArgumentException();
 			}
@@ -450,6 +455,27 @@
 
 		Trace.trace(Trace.INFO, "<< doUndeploy()" + module.toString());
 	}
+	
+	protected void doNoChange(IModule module) throws Exception {
+		
+		Trace.trace(Trace.INFO, ">> doNoChange() " + module.toString());
+		
+		boolean found = false;
+		try {
+			TargetModuleID id = DeploymentUtils.getTargetModuleID(module, DeploymentCommandFactory.getDeploymentManager(getServer()));
+			found = id != null;
+		} catch (TargetModuleIdNotFoundException e) {
+			Trace.trace(Trace.INFO, "TargetModuleId not found.");
+		}
+
+		if(found) {
+			start(module);
+		} else {
+			doDeploy(module);
+		}
+
+		Trace.trace(Trace.INFO, "<< doNoChange()" + module.toString());
+	}
 
 	protected void doRestart(IModule module) throws Exception {
 		Trace.trace(Trace.INFO, ">> doRestart() " + module.toString());
@@ -648,4 +674,19 @@
 	public Target[] getTargets() {
 		return null;
 	}
+	
+	public static String deltaKindToString(int kind) {
+		switch(kind) {
+		case NO_CHANGE:
+			return "NO_CHANGE";
+		case ADDED:
+			return "ADDED";
+		case CHANGED:
+			return "CHANGED";
+		case REMOVED:
+			return "REMOVED";
+		}
+		return Integer.toString(kind);
+	}
+	
 }



Mime
View raw message