[seam-commits] Seam SVN: r13575 - modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Aug 6 22:15:38 EDT 2010


Author: swd847
Date: 2010-08-06 22:15:38 -0400 (Fri, 06 Aug 2010)
New Revision: 13575

Modified:
   modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/ResourceLoaderXmlDocumentProvider.java
Log:
change to use ResourceLoadManager


Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/ResourceLoaderXmlDocumentProvider.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/ResourceLoaderXmlDocumentProvider.java	2010-08-07 02:15:11 UTC (rev 13574)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/ResourceLoaderXmlDocumentProvider.java	2010-08-07 02:15:38 UTC (rev 13575)
@@ -25,7 +25,6 @@
 import java.io.InputStream;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Set;
@@ -34,8 +33,7 @@
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.jboss.weld.extensions.resourceLoader.ResourceLoader;
-import org.jboss.weld.extensions.util.service.ServiceLoader;
+import org.jboss.weld.extensions.resourceLoader.ResourceLoaderManager;
 import org.xml.sax.InputSource;
 
 /**
@@ -47,7 +45,7 @@
 public class ResourceLoaderXmlDocumentProvider implements XmlDocumentProvider
 {
 
-   private final List<ResourceLoader> resourceLoaders;
+   private final ResourceLoaderManager manager = new ResourceLoaderManager();
 
    static final String[] DEFAULT_RESOURCES = { "seam-beans.xml", "META-INF/seam-beans.xml", "META-INF/beans.xml", "WEB-INF/beans.xml" };
 
@@ -63,11 +61,6 @@
    public ResourceLoaderXmlDocumentProvider(String[] resources)
    {
       this.resources = resources;
-      resourceLoaders = new ArrayList<ResourceLoader>();
-      for (ResourceLoader resourceLoader : ServiceLoader.load(ResourceLoader.class))
-      {
-         resourceLoaders.add(resourceLoader);
-      }
    }
 
    List<URL> docs;
@@ -95,22 +88,12 @@
 
       for (String i : resources)
       {
-         Set<URL> e = getResources(i);
+         Set<URL> e = manager.getResources(i);
          docs.addAll(e);
       }
       iterator = docs.listIterator();
    }
 
-   protected Set<URL> getResources(String resource)
-   {
-      Set<URL> ret = new HashSet<URL>();
-      for (ResourceLoader r : resourceLoaders)
-      {
-         ret.addAll(r.getResources(resource));
-      }
-      return ret;
-   }
-
    public void close()
    {
       if (stream != null)



More information about the seam-commits mailing list