geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r399692 - in /geronimo/devtools/eclipse-plugin/trunk: config-store-service/src/main/java/org/apache/geronimo/devtools/ plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ plugins/org.apache.geronimo.st.jmxagent/ plugins/org...
Date Thu, 04 May 2006 12:57:53 GMT
Author: sppatel
Date: Thu May  4 05:57:51 2006
New Revision: 399692

URL: http://svn.apache.org/viewcvs?rev=399692&view=rev
Log:
need to map of base install not server id's

Modified:
    geronimo/devtools/eclipse-plugin/trunk/config-store-service/src/main/java/org/apache/geronimo/devtools/EclipseAwareConfigurationStore.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ModuleArtifactMapper.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolver.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolverMBean.java

Modified: geronimo/devtools/eclipse-plugin/trunk/config-store-service/src/main/java/org/apache/geronimo/devtools/EclipseAwareConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/config-store-service/src/main/java/org/apache/geronimo/devtools/EclipseAwareConfigurationStore.java?rev=399692&r1=399691&r2=399692&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/config-store-service/src/main/java/org/apache/geronimo/devtools/EclipseAwareConfigurationStore.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/config-store-service/src/main/java/org/apache/geronimo/devtools/EclipseAwareConfigurationStore.java
Thu May  4 05:57:51 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.geronimo.devtools;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
@@ -42,7 +43,6 @@
 	private static final Log log = LogFactory.getLog(EclipseAwareConfigurationStore.class);
 
 	public EclipseAwareConfigurationStore(WritableListableRepository repository) {
-
 		super(repository);
 	}
 
@@ -64,7 +64,7 @@
 		JMXConnector connector = null;
 
 		try {
-			
+
 			Map env = new HashMap();
 			env.put(JMXConnectorServerFactory.PROTOCOL_PROVIDER_CLASS_LOADER, this.getClass().getClassLoader());
 
@@ -76,7 +76,11 @@
 			String configId = getConfigId(artifact);
 			log.debug("Resolving: " + configId + " " + module + " " + path);
 
-			result = (Set) connection.invoke(on, "resolve", new Object[] { configId, module, path
}, new String[] { "java.lang.String", "java.lang.String", "java.lang.String" });
+			String base = System.getProperty("org.apache.geronimo.base.dir");
+			
+			result = (Set) connection.invoke(on, "resolve", 
+					new Object[] { new File(base), configId, module, path }, 
+					new String[] { File.class.getName(), String.class.getName(),String.class.getName(),
String.class.getName() });
 
 			log.debug("Resolved to: " + result);
 
@@ -92,7 +96,7 @@
 		}
 		return result;
 	}
-	
+
 	private String getConfigId(Artifact artifact) {
 		StringBuffer buffer = new StringBuffer();
 		buffer.append(artifact.getGroupId());
@@ -112,7 +116,7 @@
 		builder.addAttribute("kernel", Kernel.class, false);
 		builder.addAttribute("objectName", String.class, false);
 		builder.addReference("Repository", WritableListableRepository.class, "Repository");
-		builder.setConstructor(new String[] { "kernel", "objectName", "Repository" });
+		builder.setConstructor(new String[] { "kernel", "objectName", "Repository"});
 		GBEAN_INFO = builder.getBeanInfo();
 	}
 

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/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ModuleArtifactMapper.java?rev=399692&r1=399691&r2=399692&view=diff
==============================================================================
--- 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
Thu May  4 05:57:51 2006
@@ -17,6 +17,7 @@
 
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -33,7 +34,7 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.util.SocketUtil;
 
 import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.xml.DomDriver;
@@ -41,11 +42,11 @@
 public class ModuleArtifactMapper {
 
 	private static ModuleArtifactMapper instance = new ModuleArtifactMapper();
-	
+
 	private static final String FILE_NAME = "servermodule.info";
 
 	HashMap serverEntries;
-	
+
 	XStream xStream;
 
 	private ModuleArtifactMapper() {
@@ -60,27 +61,33 @@
 	}
 
 	public IProject resolve(IServer server, String configId) {
-		Map artifactEntries = (Map) serverEntries.get(server.getId());
-		if (artifactEntries != null) {
-			String projectName = (String) artifactEntries.get(configId);
-			if (projectName != null)
-				return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
-		}
-		return null;
+		File runtimeLoc = server.getRuntime().getLocation().toFile();
+		return resolve(runtimeLoc, configId);
 	}
 
 	public void addEntry(IServer server, IProject project, String configId) {
-		Map artifactEntries = (Map) serverEntries.get(server.getId());
+
+		if (!SocketUtil.isLocalhost(server.getHost()))
+			return;
+
+		File runtimeLoc = server.getRuntime().getLocation().toFile();
+		Map artifactEntries = (Map) serverEntries.get(runtimeLoc);
 		if (artifactEntries == null) {
 			artifactEntries = new HashMap();
-			serverEntries.put(server.getId(), artifactEntries);
+			serverEntries.put(runtimeLoc, artifactEntries);
 		}
+
 		artifactEntries.put(configId, project.getName());
 	}
-	
-	public IProject resolve(String serverId, String configId) {
-		IServer server = ServerCore.findServer(serverId);
-		return resolve(server, configId);
+
+	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;
 	}
 
 	public void save() {
@@ -113,7 +120,7 @@
 				InputStream buffer = new BufferedInputStream(file);
 				input = new ObjectInputStream(buffer);
 				String xml = (String) input.readObject();
-				serverEntries = (HashMap)xStream.fromXML(xml);
+				serverEntries = (HashMap) xStream.fromXML(xml);
 			}
 		} catch (Exception e) {
 			e.printStackTrace();

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml?rev=399692&r1=399691&r2=399692&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/pom.xml
Thu May  4 05:57:51 2006
@@ -145,5 +145,10 @@
             <artifactId>mx4j</artifactId>
             <version>3.0.1</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.devtools</groupId>
+            <artifactId>org.apache.geronimo.st.core</artifactId>
+            <version>${org.apache.geronimo.st.core_version}</version>
+        </dependency>
     </dependencies>
 </project>

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolver.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolver.java?rev=399692&r1=399691&r2=399692&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolver.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolver.java
Thu May  4 05:57:51 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.geronimo.st.jmxagent;
 
+import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.HashSet;
@@ -33,15 +34,18 @@
 
 public class ConfigurationStoreResolver implements ConfigurationStoreResolverMBean {
 
-	public Set resolve(String configId, String module, String path) throws Exception {
-
-		Trace.trace(Trace.INFO, "ConfigStore Resolve Query: " + configId + ":" + module + ":" +
path);
+	public Set resolve(File repoRoot, String configId, String module, String path) throws Exception
{
 		
-		IProject project = ModuleArtifactMapper.getInstance().resolve("", configId);
+		Trace.trace(Trace.INFO, "ConfigStore Resolve Query: " + configId + ":" + module + ":" +
path);
+		Trace.trace(Trace.INFO, "BaseDir:" + repoRoot);
+
+		IProject project = ModuleArtifactMapper.getInstance().resolve(repoRoot, configId);
 
 		if (project == null) {
 			throw new Exception("Could not find project in workspace for configId " + configId);
 		}
+		
+		Trace.trace(Trace.INFO, "Found project " + project.getName());
 
 		if (module != null && J2EEProjectUtilities.isEARProject(project)) {
 			EARArtifactEdit edit = EARArtifactEdit.getEARArtifactEditForRead(project);

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolverMBean.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolverMBean.java?rev=399692&r1=399691&r2=399692&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolverMBean.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolverMBean.java
Thu May  4 05:57:51 2006
@@ -15,10 +15,11 @@
  */
 package org.apache.geronimo.st.jmxagent;
 
+import java.io.File;
 import java.util.Set;
 
 public interface ConfigurationStoreResolverMBean {
 	
-	public Set resolve(String configId, String module, String path) throws Exception;
+	public Set resolve(File repoRoot, String configId, String module, String path) throws Exception;
 
 }



Mime
View raw message