Top Description Inners Fields Constructors Methods
com.sun.enterprise.module.impl

pack-priv final Class ClassLoaderFacade

extends URLClassLoader
Class Inheritance
Imports
com.sun.enterprise.module.common_impl.LogHelper, java.io.IOException, .PrintStream, org.glassfish.hk2.utilities.CleanerFactory, java.net.URL, .URLClassLoader, java.util.Enumeration, .HashSet, .ArrayList, java.util.logging.Level

Facade for ModuleClassLoader to only expose public classes.
Author
dochez

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
private static final URL[]
private ModuleClassLoader
private HashSet<String>
private ArrayList<String>

Constructor Summary

AccessConstructor and Description
public
ClassLoaderFacade(ModuleClassLoader privateLoader)

Creates a new instance of ClassLoaderFacade

Method Summary

Modifier and TypeMethod and Description
public void
protected Class<T>
findClass(String name)

Overrides java.net.URLClassLoader.findClass.

Finds and loads the class with the specified name from the URL search path.

public URL
findResource(String name)

Overrides java.net.URLClassLoader.findResource.

Finds the resource with the specified name on the URL search path.

pack-priv URL
findResourceDirect(String name)

Works like findResource(String) but only looks at this module, without delegating to ancestors.

public Enumeration<URL>
findResources(String name)

Overrides java.net.URLClassLoader.findResources.

Returns an Enumeration of URLs representing all of the resources on the URL search path having the specified name.

pack-priv Class<T>
getClass(String name)

Tries to find a class from the ModuleClassLoader that this facade is wrapping, without doing further delegation to ancestors.

public String[]
pack-priv boolean
public final void
public void
setPublicPkgs(String[] publicPkgs)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.net.URLClassLoader:
addURLclosedefinePackagegetPermissionsgetResourceAsStreamgetURLsnewInstancenewInstance

Field Detail

classesLoadedback to summary
private int classesLoaded
EMPTY_URLSback to summary
private static final URL[] EMPTY_URLS
privateLoaderback to summary
private ModuleClassLoader privateLoader
publicPkgsback to summary
private HashSet<String> publicPkgs
publicSetback to summary
private ArrayList<String> publicSet

Constructor Detail

ClassLoaderFacadeback to summary
public ClassLoaderFacade(ModuleClassLoader privateLoader)

Creates a new instance of ClassLoaderFacade

Method Detail

dumpStateback to summary
public void dumpState(PrintStream writer)
findClassback to summary
protected Class<T> findClass(String name) throws ClassNotFoundException

Overrides java.net.URLClassLoader.findClass.

Doc from java.net.URLClassLoader.findClass.

Finds and loads the class with the specified name from the URL search path. Any URLs referring to JAR files are loaded and opened as needed until the class is found.

Exceptions
ClassNotFoundException:
if the class could not be found, or if the loader is closed.
findResourceback to summary
public URL findResource(String name)

Overrides java.net.URLClassLoader.findResource.

Doc from java.net.URLClassLoader.findResource.

Finds the resource with the specified name on the URL search path.

findResourceDirectback to summary
pack-priv URL findResourceDirect(String name)

Works like findResource(String) but only looks at this module, without delegating to ancestors.

findResourcesback to summary
public Enumeration<URL> findResources(String name) throws IOException

Overrides java.net.URLClassLoader.findResources.

Doc from java.net.URLClassLoader.findResources.

Returns an Enumeration of URLs representing all of the resources on the URL search path having the specified name.

Exceptions
IOException:
if an I/O exception occurs
getClassback to summary
pack-priv Class<T> getClass(String name) throws ClassNotFoundException

Tries to find a class from the ModuleClassLoader that this facade is wrapping, without doing further delegation to ancestors.

getPublicPkgsback to summary
public String[] getPublicPkgs()
matchExportedPackageback to summary
pack-priv boolean matchExportedPackage(String name)
registerStopEventback to summary
public final void registerStopEvent()
setPublicPkgsback to summary
public void setPublicPkgs(String[] publicPkgs)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

com.sun.enterprise.module.impl back to summary

private final Class ClassLoaderFacade.FacadeCleaner

extends Object
implements Runnable
Class Inheritance
  • java.lang.Object
  • com.sun.enterprise.module.impl.ClassLoaderFacade.FacadeCleaner
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final ModuleClassLoader

Constructor Summary

AccessConstructor and Description
pack-priv
FacadeCleaner(ModuleClassLoader moduleClassLoader)

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

moduleClassLoaderback to summary
private final ModuleClassLoader moduleClassLoader

Constructor Detail

FacadeCleanerback to summary
pack-priv FacadeCleaner(ModuleClassLoader moduleClassLoader)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override