geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r452569 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core: GeronimoServerBehaviourDelegate.java ModuleArtifactMapper.java
Date Tue, 03 Oct 2006 16:58:45 GMT
Author: sppatel
Date: Tue Oct  3 09:58:44 2006
New Revision: 452569

URL: http://svn.apache.org/viewvc?view=rev&rev=452569
Log:
use project as key in project-config id map

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ModuleArtifactMapper.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=452569&r1=452568&r2=452569
==============================================================================
--- 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
Tue Oct  3 09:58:44 2006
@@ -408,9 +408,7 @@
 				doFail(status, Messages.DISTRIBUTE_FAIL);
 			}
 
-			TargetModuleID[] ids = ((DeploymentCmdStatus) status).getResultTargetModuleIDs();
-			ModuleArtifactMapper mapper = ModuleArtifactMapper.getInstance();
-			mapper.addEntry(getServer(), module.getProject(), ids[0].getModuleID());
+			TargetModuleID[] ids = updateServerModuleConfigIDMap(module, status);
 
 			status = start(ids);
 			if (!status.isOK()) {
@@ -427,6 +425,13 @@
 		Trace.trace(Trace.INFO, "<< doDeploy() " + module.toString());
 	}
 
+	private TargetModuleID[] updateServerModuleConfigIDMap(IModule module, IStatus status) {
+		TargetModuleID[] ids = ((DeploymentCmdStatus) status).getResultTargetModuleIDs();
+		ModuleArtifactMapper mapper = ModuleArtifactMapper.getInstance();
+		mapper.addEntry(getServer(), module.getProject(), ids[0].getModuleID());
+		return ids;
+	}
+
 	protected void doRedeploy(IModule module) throws Exception {
 		Trace.trace(Trace.INFO, ">> doRedeploy() " + module.toString());
 
@@ -435,6 +440,9 @@
 			if (!status.isOK()) {
 				doFail(status, Messages.REDEPLOY_FAIL);
 			}
+			
+			updateServerModuleConfigIDMap(module, status);
+			
 		} catch (TargetModuleIdNotFoundException e) {
 			Activator.log(Status.WARNING, "Module may have been uninstalled outside the workspace.",
e);
 			doDeploy(module);

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ModuleArtifactMapper.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ModuleArtifactMapper.java?view=diff&rev=452569&r1=452568&r2=452569
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ModuleArtifactMapper.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ModuleArtifactMapper.java
Tue Oct  3 09:58:44 2006
@@ -62,11 +62,6 @@
 		return instance;
 	}
 
-	public IProject resolve(IServer server, String configId) {
-		File runtimeLoc = server.getRuntime().getLocation().toFile();
-		return resolve(runtimeLoc, configId);
-	}
-
 	public void addEntry(IServer server, IProject project, String configId) {
 
 		if (!SocketUtil.isLocalhost(server.getHost()))
@@ -79,32 +74,13 @@
 			serverEntries.put(runtimeLoc, artifactEntries);
 		}
 
-		artifactEntries.put(configId, project.getName());
-	}
-
-	public IProject resolve(File baseDir, String configId) {
-		Map artifactEntries = (Map) serverEntries.get(baseDir);
-		if (artifactEntries != null) {
-			String projectName = (String) artifactEntries.get(configId);
-			if (projectName != null)
-				return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
-		}
-		return null;
+		artifactEntries.put(project.getName(), configId);
 	}
 	
 	public String resolve(IServer server, IModule module) {
 		Map artifactEntries = (Map) serverEntries.get(server.getRuntime().getLocation().toFile());
 		if (artifactEntries != null) {
-			String projectName = module.getProject().getName();
-			if(artifactEntries.containsValue(projectName)) {
-				Iterator i = artifactEntries.keySet().iterator();
-				while(i.hasNext()) {
-					String configId = (String) i.next();
-					if(artifactEntries.get(configId).equals(projectName)) {
-						return configId;
-					}
-				}
-			}
+			return (String) artifactEntries.get(module.getProject().getName());
 		}
 		return null;
 	}



Mime
View raw message