[jboss-cvs] JBossAS SVN: r106474 - projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/infinispan/config/xml.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 6 16:29:56 EDT 2010


Author: pferraro
Date: 2010-07-06 16:29:56 -0400 (Tue, 06 Jul 2010)
New Revision: 106474

Modified:
   projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/infinispan/config/xml/XMLCacheManagerRegistryConfigurationSource.java
Log:
Simplify constructors.

Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/infinispan/config/xml/XMLCacheManagerRegistryConfigurationSource.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/infinispan/config/xml/XMLCacheManagerRegistryConfigurationSource.java	2010-07-06 20:25:06 UTC (rev 106473)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/infinispan/config/xml/XMLCacheManagerRegistryConfigurationSource.java	2010-07-06 20:29:56 UTC (rev 106474)
@@ -68,7 +68,9 @@
     */
    public XMLCacheManagerRegistryConfigurationSource(URL url)
    {
-      this(url, defaultClassLoader());
+      this.xmlURL = url;
+      this.schemaURL = findResource(SCHEMA);
+      this.infinispanSchemaURL = findResource(INFINISPAN_SCHEMA);
    }
    
    /**
@@ -78,41 +80,12 @@
     */
    public XMLCacheManagerRegistryConfigurationSource(String resource)
    {
-      this(resource, defaultClassLoader());
+      this(findResource(resource));
    }
    
-   /**
-    * Creates a new XMLCacheManagerRegistryConfigurationSource using the specified classpath resource containing
-    * the cache manager registry configuration and specified class loader to locate the specified resource and relevant schemas.
-    * @param resource the classpath resource containing the cache manager registry configuration
-    * @param loader the class loader used to locate the specified resource and relevant schemas
-    */
-   public XMLCacheManagerRegistryConfigurationSource(String resource, ClassLoader loader)
+   private static URL findResource(String resource)
    {
-      this(findResource(resource, loader), loader);
-   }
-   
-   /**
-    * Creates a new XMLCacheManagerRegistryConfigurationSource using the specified location containing
-    * the cache manager registry configuration and specified class loader to locate relevant schemas.
-    * @param url the location of the cache manager registry configuration
-    * @param loader the class loader used to locate relevant schemas
-    */
-   public XMLCacheManagerRegistryConfigurationSource(URL url, ClassLoader loader)
-   {
-      this.xmlURL = url;
-      this.schemaURL = findResource(SCHEMA, loader);
-      this.infinispanSchemaURL = findResource(INFINISPAN_SCHEMA, loader);
-   }
-   
-   private static ClassLoader defaultClassLoader()
-   {
-      return Thread.currentThread().getContextClassLoader();
-   }
-   
-   private static URL findResource(String resource, ClassLoader loader)
-   {
-      URL url = loader.getResource(resource);
+      URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
       
       if (url == null)
       {



More information about the jboss-cvs-commits mailing list