[jbosstools-commits] JBoss Tools SVN: r30896 - in trunk/as/plugins: org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Apr 28 03:50:07 EDT 2011


Author: rob.stryker at jboss.com
Date: 2011-04-28 03:50:07 -0400 (Thu, 28 Apr 2011)
New Revision: 30896

Modified:
   trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
   trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathCorePlugin.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
Log:
AS7 - classpath work.  Classpath container now resolves but suffers from same issue as AS-6, too many open files

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml	2011-04-28 07:20:06 UTC (rev 30895)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml	2011-04-28 07:50:07 UTC (rev 30896)
@@ -94,6 +94,13 @@
       <factory class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$Factory"/>
       <type class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
 	</adapter>
+
+	<adapter>
+      <runtime-component
+            id="org.jboss.ide.eclipse.as.runtime.component" version="7.0"/>
+      <factory class="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeClasspathProvider$Factory"/>
+      <type class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+	</adapter>
 	
      <adapter>
       <runtime-component
@@ -124,7 +131,7 @@
    <extension point="org.eclipse.jst.server.core.runtimeClasspathProviders">
      <runtimeClasspathProvider
         id="org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget"
-        runtimeTypeIds="org.jboss.ide.eclipse.as.runtime.32, org.jboss.ide.eclipse.as.runtime.40, org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50"
+        runtimeTypeIds="org.jboss.ide.eclipse.as.runtime.32, org.jboss.ide.eclipse.as.runtime.40, org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.70,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50"
         class="org.jboss.ide.eclipse.as.classpath.core.runtime.ClientAllRuntimeClasspathProvider"/>
    </extension>
    <extension

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathCorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathCorePlugin.java	2011-04-28 07:20:06 UTC (rev 30895)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathCorePlugin.java	2011-04-28 07:50:07 UTC (rev 30896)
@@ -115,13 +115,9 @@
 			return null;
 
 		IJBossServerRuntime jbsrt = (IJBossServerRuntime)runtime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
-		if( jbsrt == null ) {
-			return null;
-		}
-		
 		IPath loc = runtime.getLocation();
-		IPath configPath = jbsrt.getConfigurationFullPath();
 		String rtID  = runtime.getRuntimeType().getId();
+		IPath configPath = jbsrt == null ? null : jbsrt.getConfigurationFullPath();
 		return new RuntimeKey(loc, configPath, rtID);
 	}
 }

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java	2011-04-28 07:20:06 UTC (rev 30895)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java	2011-04-28 07:50:07 UTC (rev 30896)
@@ -135,6 +135,8 @@
 		if(AS_60.equals(rtID)) list = get60(loc,configPath);
 		if(EAP_50.equals(rtID)) list = get50(loc,configPath);
 		
+		if( AS_70.equals(rtID)) list = get70(loc);
+		
 		if( list == null ) {
 			runtimeClasspath = new IClasspathEntry[0];
 		} else {
@@ -207,21 +209,33 @@
 		return list;
 	}
 	
+	protected Set<Entry> get70(IPath location) {
+		Set<Entry> list = new HashSet<Entry>();
+		addPaths(location.append(AS7_MODULES), list, true);
+		return list;
+	}
+	
 	protected IClasspathEntry getEntry(Entry entry) {
 		return JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath()).getClasspathEntry();
 	}
 
 	protected void addPaths(IPath folder, Set<Entry> list) {
+		addPaths(folder, list, false);
+	}
+	
+	protected void addPaths(IPath folder, Set<Entry> list, boolean recurse) {
 		if( folder.toFile().exists()) {
 			File f = folder.toFile();
 			if(f.isDirectory()) {
-				String[] files = f.list();
-				for( int i = 0; i < files.length; i++ ) {
-					if( files[i].endsWith(EXT_JAR) && ClientAllFilter.accepts(folder.append(files[i]))) {
-						addSinglePath(folder.append(files[i]), list);
+				File[] asFiles = f.listFiles();
+				for( int i = 0; i < asFiles.length; i++ ) {
+					if( asFiles[i].getName().endsWith(EXT_JAR) && ClientAllFilter.accepts(folder.append(asFiles[i].getName()))) {
+						addSinglePath(folder.append(asFiles[i].getName()), list);
+					} else if( recurse && asFiles[i].isDirectory()) {
+						addPaths(folder.append(asFiles[i].getName()), list, true);
 					}
 				}
-			} else { // folder is a file, not a folder
+			} else { // item is a file, not a folder
 				addSinglePath(folder, list);
 			}
 		}

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java	2011-04-28 07:20:06 UTC (rev 30895)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossRuntimeResourceConstants.java	2011-04-28 07:50:07 UTC (rev 30896)
@@ -28,6 +28,7 @@
 	public static final String NATIVE = "native"; //$NON-NLS-1$
 	public static final String AS7_STANDALONE = "standalone";//$NON-NLS-1$
 	public static final String AS7_DEPLOYMENTS = "deployments";//$NON-NLS-1$
+	public static final String AS7_MODULES = "modules";//$NON-NLS-1$
 	
 	public static final String[] JBOSS_TEMPORARY_FOLDERS = new String[] { WORK, DATA, FOLDER_TMP, FOLDER_LOG};
 



More information about the jbosstools-commits mailing list