geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r399774 - in /geronimo/devtools/eclipse-plugin/trunk: config-store-service/src/main/java/org/apache/geronimo/devtools/ plugins/org.apache.geronimo.st.jmxagent/src/org/apache/geronimo/st/jmxagent/
Date Thu, 04 May 2006 17:10:30 GMT
Author: sppatel
Date: Thu May  4 10:10:29 2006
New Revision: 399774

URL: http://svn.apache.org/viewcvs?rev=399774&view=rev
Log:
resolver updates

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.jmxagent/src/org/apache/geronimo/st/jmxagent/ConfigurationStoreResolver.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=399774&r1=399773&r2=399774&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 10:10:29 2006
@@ -17,8 +17,9 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -60,11 +61,11 @@
 
 		log.debug("--> EclipseAwareConfigurationStore.resolve()");
 
-		Set result = Collections.EMPTY_SET;
 		JMXConnector connector = null;
+		
+		Set urls = new HashSet();
 
 		try {
-
 			Map env = new HashMap();
 			env.put(JMXConnectorServerFactory.PROTOCOL_PROVIDER_CLASS_LOADER, this.getClass().getClassLoader());
 
@@ -78,11 +79,16 @@
 
 			String base = System.getProperty("org.apache.geronimo.base.dir");
 			
-			result = (Set) connection.invoke(on, "resolve", 
+			Set 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);
+			Iterator i = result.iterator();
+			while(i.hasNext()) {
+				urls.add(((File) i.next()).toURL());
+			}
+			
+			log.debug("Resolved to: " + urls);
 
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -94,7 +100,8 @@
 					e.printStackTrace();
 				}
 		}
-		return result;
+		
+		return urls;
 	}
 
 	private String getConfigId(Artifact artifact) {

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=399774&r1=399773&r2=399774&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 10:10:29 2006
@@ -16,8 +16,6 @@
 package org.apache.geronimo.st.jmxagent;
 
 import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -65,39 +63,33 @@
 			}
 		}
 
-		Set urls = new HashSet();
+		Set result = new HashSet();
 
 		if (path == null || path.length() == 0) {
 			StructureEdit moduleCore = StructureEdit.getStructureEditForRead(project);
 			try {
 				WorkbenchComponent component = moduleCore.getComponent();
 				IPath loc = ((WorkbenchComponentImpl) component).getDefaultSourceRoot();
-				try {
-					URL url = project.findMember(loc).getLocation().toFile().toURL();
-					urls.add(url);
-				} catch (MalformedURLException e) {
-					e.printStackTrace();
-				}
-
+				result.add(project.findMember(loc).getLocation().toFile());
 			} finally {
 				if (moduleCore != null)
 					moduleCore.dispose();
 			}
 		} else {
-			// return output containers
-			IContainer[] containers = J2EEProjectUtilities.getOutputContainers(project);
-			for (int i = 0; i < containers.length; i++) {
-				try {
-					urls.add(containers[i].getLocation().toFile().toURL());
-				} catch (MalformedURLException e) {
-					e.printStackTrace();
-				}
-			}
+			//return output containers
+			addOutputContainers(project, result);
 		}
 		
-		Trace.trace(Trace.INFO, "ConfigStore Resolve Result: " + urls);
+		Trace.trace(Trace.INFO, "ConfigStore Resolve Result: " + result);
 
-		return urls;
+		return result;
 
+	}
+	
+	private void addOutputContainers(IProject project, Set result) {
+		IContainer[] containers = J2EEProjectUtilities.getOutputContainers(project);
+		for (int i = 0; i < containers.length; i++) {
+			result.add(containers[i].getLocation().toFile());
+		}
 	}
 }



Mime
View raw message