accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1482599 - in /accumulo/trunk: ./ start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java test/src/test/java/org/apache/accumulo/test/ShellServerTest.java
Date Tue, 14 May 2013 21:26:57 GMT
Author: vines
Date: Tue May 14 21:26:57 2013
New Revision: 1482599

URL: http://svn.apache.org/r1482599
Log:
ACCUMULO-1274 - Descriptive classpath stuff


Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1482596

Modified: accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java?rev=1482599&r1=1482598&r2=1482599&view=diff
==============================================================================
--- accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
(original)
+++ accumulo/trunk/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloVFSClassLoader.java
Tue May 14 21:26:57 2013
@@ -73,7 +73,7 @@ public class AccumuloVFSClassLoader {
   
   private static List<WeakReference<DefaultFileSystemManager>> vfsInstances =
Collections
       .synchronizedList(new ArrayList<WeakReference<DefaultFileSystemManager>>());
-
+  
   public static final String DYNAMIC_CLASSPATH_PROPERTY_NAME = "general.dynamic.classpaths";
   
   public static final String DEFAULT_DYNAMIC_CLASSPATH_VALUE = "$ACCUMULO_HOME/lib/ext/[^.].*.jar\n";
@@ -198,9 +198,8 @@ public class AccumuloVFSClassLoader {
       synchronized (lock) {
         if (null == loader) {
           
-          
           FileSystemManager vfs = generateVfs();
-
+          
           // Set up the 2nd tier class loader
           if (null == parent) {
             parent = AccumuloClassLoader.getClassLoader();
@@ -302,17 +301,38 @@ public class AccumuloVFSClassLoader {
           out.print("");
         level++;
         
+        String classLoaderDescription;
+        
+        switch (level) {
+          case 1:
+            classLoaderDescription = level + ": Java System Classloader (loads Java)";
+            break;
+          case 2:
+            classLoaderDescription = level + ": Accumulo Start Classloader (loads the classloader)";
+            break;
+          case 3:
+            classLoaderDescription = level + ": Accumulo Classloader (loads everything defined
by general.classpaths)";
+            break;
+          case 4:
+            classLoaderDescription = level + ": Accumulo Dynamic Classloader (loads everything
defined by general.dynamic.classpaths)";
+            break;
+          default:
+            classLoaderDescription = level + ": Mystery Classloader (someone probably added
a classloader and didn't update the switch statement in "
+                + AccumuloVFSClassLoader.class.getName() + ")";
+            break;
+        }
+        
         if (classLoader instanceof URLClassLoader) {
           // If VFS class loader enabled, but no contexts defined.
           URLClassLoader ucl = (URLClassLoader) classLoader;
-          out.print("Level " + level + " URL classpath items are:");
+          out.print("Level " + classLoaderDescription + " URL classpath items are:");
           
           for (URL u : ucl.getURLs()) {
             out.print("\t" + u.toExternalForm());
           }
           
         } else if (classLoader instanceof VFSClassLoader) {
-          out.print("Level " + level + " VFS classpaths items are:");
+          out.print("Level " + classLoaderDescription + " VFS classpaths items are:");
           VFSClassLoader vcl = (VFSClassLoader) classLoader;
           for (FileObject f : vcl.getFileObjects()) {
             out.print("\t" + f.getURL().toExternalForm());

Modified: accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java?rev=1482599&r1=1482598&r2=1482599&view=diff
==============================================================================
--- accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java (original)
+++ accumulo/trunk/test/src/test/java/org/apache/accumulo/test/ShellServerTest.java Tue May
14 21:26:57 2013
@@ -394,7 +394,7 @@ public class ShellServerTest {
   @Test(timeout = 30000)
   public void classpath() throws Exception {
     // classpath
-    exec("classpath", true, "Level 2 URL classpath items are", true);
+    exec("classpath", true, "Level 2: Accumulo Start Classloader (Loads the classloader)
URL classpath items are", true);
   }
   
   @Test(timeout = 30000)



Mime
View raw message