org.apache.accumulo.start.classloader
Class AccumuloClassLoader

java.lang.Object
  extended by org.apache.accumulo.start.classloader.AccumuloClassLoader

public class AccumuloClassLoader
extends java.lang.Object

This class builds a hierarchy of Classloaders in the form of:

 SystemClassLoader
       ^
       |
 URLClassLoader that references the URLs for HADOOP_HOME, ZOOKEEPER_HOME, ACCUMULO_HOME and their associated directories
       ^
       |
 URLClassLoader that references ACCUMULO_HOME/lib/ext, locations from the ACCUMULO property general.dynamic.classpaths and $ACCUMULO_XTRAJARS
 
The last URLClassLoader in the chain monitors the directories for changes every 3 seconds (default value). If a change occurs, the last URLClassLoader is abandoned and a new one is created. Objects that still reference the abandoned URLClassLoader will cause it to not be garbage collected until those objects are garbage collected. If reload happens often enough it may cause excessive memory usage.


Field Summary
static java.lang.String ACCUMULO_CLASSPATH_VALUE
           
static java.lang.String CLASSPATH_PROPERTY_NAME
           
static java.lang.String DEFAULT_CLASSPATH_VALUE
           
static java.lang.String DYNAMIC_CLASSPATH_PROPERTY_NAME
           
static java.lang.String DYNAMIC_CLASSPATH_VALUE
          Dynamic classpath.
 
Constructor Summary
AccumuloClassLoader()
           
 
Method Summary
static java.lang.ClassLoader getClassLoader()
           
static java.lang.Class<?> loadClass(java.lang.String classname)
           
static
<U> java.lang.Class<? extends U>
loadClass(java.lang.String classname, java.lang.Class<U> extension)
           
static void printClassPath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSPATH_PROPERTY_NAME

public static final java.lang.String CLASSPATH_PROPERTY_NAME
See Also:
Constant Field Values

DYNAMIC_CLASSPATH_PROPERTY_NAME

public static final java.lang.String DYNAMIC_CLASSPATH_PROPERTY_NAME
See Also:
Constant Field Values

ACCUMULO_CLASSPATH_VALUE

public static final java.lang.String ACCUMULO_CLASSPATH_VALUE
See Also:
Constant Field Values

DYNAMIC_CLASSPATH_VALUE

public static final java.lang.String DYNAMIC_CLASSPATH_VALUE
Dynamic classpath. These locations will be monitored for changes.

See Also:
Constant Field Values

DEFAULT_CLASSPATH_VALUE

public static final java.lang.String DEFAULT_CLASSPATH_VALUE
See Also:
Constant Field Values
Constructor Detail

AccumuloClassLoader

public AccumuloClassLoader()
Method Detail

printClassPath

public static void printClassPath()

loadClass

public static <U> java.lang.Class<? extends U> loadClass(java.lang.String classname,
                                                         java.lang.Class<U> extension)
                                              throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

loadClass

public static java.lang.Class<?> loadClass(java.lang.String classname)
                                    throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getClassLoader

public static java.lang.ClassLoader getClassLoader()
                                            throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.