Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 36821 invoked from network); 6 Feb 2006 21:38:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Feb 2006 21:38:26 -0000 Received: (qmail 74746 invoked by uid 500); 6 Feb 2006 21:38:25 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 74732 invoked by uid 500); 6 Feb 2006 21:38:25 -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 74721 invoked by uid 99); 6 Feb 2006 21:38:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2006 13:38:25 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,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; Mon, 06 Feb 2006 13:38:24 -0800 Received: (qmail 36648 invoked by uid 65534); 6 Feb 2006 21:38:03 -0000 Message-ID: <20060206213803.36647.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r375386 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core: schema/discouragedRuntimeAccess.exsd src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java Date: Mon, 06 Feb 2006 21:38:03 -0000 To: scm@geronimo.apache.org From: sppatel@apache.org X-Mailer: svnmailer-1.0.6 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sppatel Date: Mon Feb 6 13:38:01 2006 New Revision: 375386 URL: http://svn.apache.org/viewcvs?rev=375386&view=rev Log: need to bind extension point to runtimeTypeId Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/schema/discouragedRuntimeAccess.exsd geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/schema/discouragedRuntimeAccess.exsd URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/schema/discouragedRuntimeAccess.exsd?rev=375386&r1=375385&r2=375386&view=diff ============================================================================== --- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/schema/discouragedRuntimeAccess.exsd (original) +++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/schema/discouragedRuntimeAccess.exsd Mon Feb 6 13:38:01 2006 @@ -13,7 +13,7 @@ - + @@ -44,7 +44,22 @@ - + + + + + + + + + + + + + + + + Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java?rev=375386&r1=375385&r2=375386&view=diff ============================================================================== --- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java (original) +++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java Mon Feb 6 13:38:01 2006 @@ -17,10 +17,11 @@ import java.io.File; import java.util.ArrayList; -import java.util.HashSet; +import java.util.Collection; +import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Set; +import java.util.Map; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionRegistry; @@ -45,26 +46,39 @@ String cachedArchiveString = null; IClasspathEntry[] cachedClasspath = null; - private static Set discouragedAccessPaths; + private static Map map; private IPath runtimeLoc; + private String runtimeTypeId; static { loadExtensions(); } private static synchronized void loadExtensions() { - discouragedAccessPaths = new HashSet(); + map = new HashMap(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] cf = registry.getConfigurationElementsFor( GeronimoPlugin.PLUGIN_ID, EXTENSION_RUNTIME_ACCESS); for (int i = 0; i < cf.length; i++) { IConfigurationElement element = cf[i]; - if ("path".equals(element.getName())) { - String path = element.getAttribute("value"); - if (path != null) { - discouragedAccessPaths.add(new Path(path)); + if ("restriction".equals(element.getName())) { + String runtimeId = element.getAttribute("id"); + if (runtimeId != null) { + IConfigurationElement[] children = element.getChildren(); + for (int j = 0; j < children.length; j++) { + String path = children[j].getAttribute("value"); + if (path != null) { + Collection c = (Collection) map.get(runtimeId); + if (c == null) { + c = new ArrayList(); + map.put(runtimeId, c); + } + c.add(new Path(path)); + } + } } } + } } @@ -76,6 +90,8 @@ */ public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime, String id) { + System.out.println(runtime.getRuntimeType().getId()); + this.runtimeTypeId = runtime.getRuntimeType().getId(); return getServerClassPathEntry(runtime); } @@ -126,12 +142,17 @@ } private boolean isAccessDiscouraged(IPath path) { - Iterator i = discouragedAccessPaths.iterator(); + Collection c = (Collection) map.get(runtimeTypeId); + if (c == null || c.isEmpty()) + return false; + + Iterator i = c.iterator(); while (i.hasNext()) { IPath xPath = (IPath) i.next(); - if(path.toFile().isDirectory() && runtimeLoc.append(xPath).isPrefixOf(path)) { + if (path.toFile().isDirectory() + && runtimeLoc.append(xPath).isPrefixOf(path)) { return true; - } else if(runtimeLoc.append(xPath).equals(path)) { + } else if (runtimeLoc.append(xPath).equals(path)) { return true; } }