Package com.sun.enterprise.module.impl
Class ModuleClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- com.sun.enterprise.module.impl.ClassLoaderProxy
-
- com.sun.enterprise.module.impl.ModuleClassLoader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
final class ModuleClassLoader extends ClassLoaderProxy
ClassLoader
that loads classes for a module.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
initialized
Module will be initialized when this classloader is consulted for the first time.private java.lang.String
initializerClassName
private java.lang.StackTraceElement[]
initializerThread
private static java.lang.String
META_INF_SERVICES
private ModuleImpl
module
-
Constructor Summary
Constructors Constructor Description ModuleClassLoader(ModuleImpl owner, java.net.URL[] shared, java.lang.ClassLoader parent)
Creates a new instance of ClassLoader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
dumpState(java.io.PrintStream writer)
protected void
finalize()
protected java.lang.Class<?>
findClass(java.lang.String name)
ModuleImpl
getOwner()
java.net.URL
getResource(java.lang.String name)
java.util.Enumeration<java.net.URL>
getResources(java.lang.String name)
private void
initialize(java.lang.String name)
Lazily initialize this module if not done so yet.protected java.lang.Class<?>
loadClass(java.lang.String name, boolean resolve)
void
stop()
called by the facade class loader when it is garbage collected.java.lang.String
toString()
-
Methods inherited from class com.sun.enterprise.module.impl.ClassLoaderProxy
addDelegate, addURL, findClass, findClassDirect, findResource, findResourceDirect, findResources, getDelegates, loadClass, removeDelegate
-
Methods inherited from class java.net.URLClassLoader
close, definePackage, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Field Detail
-
module
private final ModuleImpl module
-
initialized
private volatile boolean initialized
Module will be initialized when this classloader is consulted for the first time.
-
initializerThread
private java.lang.StackTraceElement[] initializerThread
-
initializerClassName
private java.lang.String initializerClassName
-
META_INF_SERVICES
private static final java.lang.String META_INF_SERVICES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModuleClassLoader
public ModuleClassLoader(ModuleImpl owner, java.net.URL[] shared, java.lang.ClassLoader parent)
Creates a new instance of ClassLoader
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classClassLoaderProxy
- Throws:
java.lang.Throwable
-
loadClass
protected java.lang.Class<?> loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
- Overrides:
loadClass
in classjava.lang.ClassLoader
- Throws:
java.lang.ClassNotFoundException
-
findClass
protected java.lang.Class<?> findClass(java.lang.String name) throws java.lang.ClassNotFoundException
- Overrides:
findClass
in classClassLoaderProxy
- Throws:
java.lang.ClassNotFoundException
-
getResource
public java.net.URL getResource(java.lang.String name)
- Overrides:
getResource
in classjava.lang.ClassLoader
-
getResources
public java.util.Enumeration<java.net.URL> getResources(java.lang.String name) throws java.io.IOException
- Overrides:
getResources
in classjava.lang.ClassLoader
- Throws:
java.io.IOException
-
initialize
private void initialize(java.lang.String name)
Lazily initialize this module if not done so yet.
-
dumpState
void dumpState(java.io.PrintStream writer)
-
stop
public void stop()
called by the facade class loader when it is garbage collected. this is a good time to see if this module should be unloaded.- Overrides:
stop
in classClassLoaderProxy
-
getOwner
public ModuleImpl getOwner()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classClassLoaderProxy
-
-