[Jboss-cvs] JBossAS SVN: r56417 - branches/MC_VDF_WORK/jmx/src/main/org/jboss/mx/loading

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 29 17:29:15 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-08-29 17:29:13 -0400 (Tue, 29 Aug 2006)
New Revision: 56417

Modified:
   branches/MC_VDF_WORK/jmx/src/main/org/jboss/mx/loading/DomainClassLoaderUCLImpl.java
Log:
Add DomainClassLoaderUCLImpl(URL[] cp, LoaderRepositoryDomain repository)

Modified: branches/MC_VDF_WORK/jmx/src/main/org/jboss/mx/loading/DomainClassLoaderUCLImpl.java
===================================================================
--- branches/MC_VDF_WORK/jmx/src/main/org/jboss/mx/loading/DomainClassLoaderUCLImpl.java	2006-08-29 21:28:07 UTC (rev 56416)
+++ branches/MC_VDF_WORK/jmx/src/main/org/jboss/mx/loading/DomainClassLoaderUCLImpl.java	2006-08-29 21:29:13 UTC (rev 56417)
@@ -16,30 +16,21 @@
 import org.jboss.util.loading.Translatable;
 
 /**
-* A ClassLoader which loads classes from a single URL in conjunction with
-* the {@link LoaderRepositoryDomain}. Notice that this classloader does
-* not work independently of the repository. A repository reference
-* must be provided via the constructor or the classloader must be explicitly
-* registered to the repository before any attempt to load a class.
+* A port of the UnifiedClassLoader3 to a DomainClassLoader
 *
-* At this point this is little more than an abstract class maintained as the
-* interface for class loaders as the algorithm of the UnifiedLoaderRepositoryDomain
-* fails with deadlocks, and several other class loading exceptions in multi-
-* threaded environments.
-*
 * @author <a href="marc.fleury at jboss.org">Marc Fleury</a>
 * @author <a href="christoph.jung at jboss.org">Christoph G. Jung</a>
 * @author <a href="scott.stark at jboss.org">Scott Stark</a>
 * @author <a href="juha at jboss.org">Juha Lindfors</a>
 * @author <a href="bill at jboss.org">Bill Burke</a>
-* @version <tt>$Revision: 44243 $</tt>
+* @version $Revision: 44243 $
 */
 public class DomainClassLoaderUCLImpl extends LegacyDomainClassLoader
    implements UnifiedClassLoaderMBean, Translatable
 {
    // Static --------------------------------------------------------
 
-   private static final Logger log = Logger.getLogger(UnifiedClassLoader.class);
+   private static final Logger log = Logger.getLogger(DomainClassLoaderUCLImpl.class);
 
    // Attributes ----------------------------------------------------
 
@@ -51,7 +42,7 @@
 
    // Constructors --------------------------------------------------
    /**
-    * Construct a <tt>UnifiedClassLoader</tt> without registering it to the
+    * Construct a DomainClassLoaderUCLImpl without registering it to the
     * classloader repository.
     *
     * @param url   the single URL to load classes from.
@@ -61,7 +52,7 @@
       this(url, (URL) null);
    }
    /**
-    * Construct a <tt>UnifiedClassLoader</tt> without registering it to the
+    * Construct a DomainClassLoaderUCLImpl without registering it to the
     * classloader repository.
     *
     * @param url   the single URL to load classes from.
@@ -70,10 +61,10 @@
     */
    public DomainClassLoaderUCLImpl(URL url, URL origURL)
    {
-      this(url, origURL, UnifiedClassLoader.class.getClassLoader());
+      this(url, origURL, DomainClassLoaderUCLImpl.class.getClassLoader());
    }
 
-   /**  Construct a UnifiedClassLoader without registering with the
+   /**  Construct a DomainClassLoaderUCLImpl without registering with the
     * classloader repository.
     *
     * @param url   the single URL to load classes from.
@@ -92,7 +83,7 @@
    }
 
    /**
-    * Construct a <tt>UnifiedClassLoader</tt> and registers it to the given
+    * Construct a DomainClassLoaderUCLImpl and registers it to the given
     * repository.
     *
     * @param   url   The single URL to load classes from.
@@ -103,13 +94,12 @@
       this(url, null, repository);
    }
    /**
-    * Construct a <tt>UnifiedClassLoader</tt> and registers it to the given
+    * Construct a DomainClassLoaderUCLImpl and registers it to the given
     * repository.
     * @param url The single URL to load classes from.
     * @param origURL the possibly null original URL from which url may
     * be a local copy or nested jar.
     * @param repository the repository this classloader delegates to
-    * be a local copy or nested jar.
     */
    public DomainClassLoaderUCLImpl(URL url, URL origURL, LoaderRepositoryDomain repository)
    {
@@ -123,7 +113,24 @@
    }
 
    /**
-    * UnifiedClassLoader constructor that can be used to
+    * Construct a DomainClassLoaderUCLImpl with the given classpath and register
+    * it to the given repository.
+    * @param cp - the loader classpath
+    * @param repository - the repository this classloader delegates to
+    */
+   public DomainClassLoaderUCLImpl(URL[] cp, LoaderRepositoryDomain repository)
+   {
+      super(cp, null);
+
+      // set the repository reference
+      this.setDomain(repository);
+
+      // register this loader to the given repository
+      repository.addClassLoader(this);
+   }
+
+   /**
+    * DomainClassLoaderUCLImpl constructor that can be used to
     * register with a particular Loader Repository identified by ObjectName.
     *
     * @param url an <code>URL</code> value
@@ -137,7 +144,7 @@
       this(url, null, server, repositoryName);
    }
    /**
-    * UnifiedClassLoader constructor that can be used to
+    * DomainClassLoaderUCLImpl constructor that can be used to
     * register with a particular Loader Repository identified by ObjectName.
     *
     * @param url an <code>URL</code> value




More information about the jboss-cvs-commits mailing list