Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 67559 invoked from network); 4 May 2006 12:58:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 May 2006 12:58:17 -0000 Received: (qmail 86762 invoked by uid 500); 4 May 2006 12:58:16 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 86729 invoked by uid 500); 4 May 2006 12:58:15 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 86718 invoked by uid 99); 4 May 2006 12:58:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 May 2006 05:58:15 -0700 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 04 May 2006 05:58:14 -0700 Received: (qmail 67427 invoked by uid 65534); 4 May 2006 12:57:54 -0000 Message-ID: <20060504125754.67424.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: scm@geronimo.apache.org From: sppatel@apache.org X-Mailer: svnmailer-1.0.8 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 @@ mx4j 3.0.1 + + org.apache.geronimo.devtools + org.apache.geronimo.st.core + ${org.apache.geronimo.st.core_version} + 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; }