Top Fields Constructors Methods
net.sf.ehcache

public Class EhcacheDefaultClassLoader

extends ClassLoader
Class Inheritance
Imports
java.io.IOException, .InputStream, java.net.URL, java.util.Enumeration

Field Summary

Modifier and TypeField and Description
private final ClassLoader
private static final ClassLoader

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ClassLoader
public URL
getResource(String
The resource name
name
)

Overrides java.lang.ClassLoader.getResource.

Finds the resource with the given name.
public InputStream
getResourceAsStream(String
The resource name
name
)

Overrides java.lang.ClassLoader.getResourceAsStream.

Returns an input stream for reading the specified resource.
public Enumeration<URL>
getResources(String
The resource name
name
)

Overrides java.lang.ClassLoader.getResources.

Finds all the resources with the given name.
public Class<?>
loadClass(String
The binary name of the class
name
)

Overrides java.lang.ClassLoader.loadClass.

Loads the class with the specified binary name.
Inherited from java.lang.ClassLoader:
clearAssertionStatusdefineClassdefineClassdefineClassdefineClassdefinePackagefindClassfindClassfindLibraryfindLoadedClassfindResourcefindResourcefindResourcesfindSystemClassgetClassLoadingLockgetDefinedPackagegetDefinedPackagesgetNamegetPackagegetPackagesgetParentgetPlatformClassLoadergetSystemClassLoadergetSystemResourcegetSystemResourceAsStreamgetSystemResourcesgetUnnamedModuleisRegisteredAsParallelCapableloadClassregisterAsParallelCapableresolveClassresourcessetClassAssertionStatussetDefaultAssertionStatussetPackageAssertionStatussetSigners

Field Detail

ehcacheLoaderback to summary
private final ClassLoader ehcacheLoader
INSTANCEback to summary
private static final ClassLoader INSTANCE

Constructor Detail

EhcacheDefaultClassLoaderback to summary
private EhcacheDefaultClassLoader()

Method Detail

getInstanceback to summary
public static ClassLoader getInstance()
getResourceback to summary
public URL getResource(String name)

Overrides java.lang.ClassLoader.getResource.

Doc from java.lang.ClassLoader.getResource.

Finds the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.

The name of a resource is a '/'-separated path name that identifies the resource.

Resources in named modules are subject to the encapsulation rules specified by Module.getResourceAsStream. Additionally, and except for the special case where the resource has a name ending with ".class", this method will only find resources in packages of named modules when the package is opened unconditionally (even if the caller of this method is in the same module as the resource).

Parameters
name:String

The resource name

Returns:URL

URL object for reading the resource; null if the resource could not be found, a URL could not be constructed to locate the resource, the resource is in a package that is not opened unconditionally, or access to the resource is denied by the security manager.

Annotations
@Override
getResourceAsStreamback to summary
public InputStream getResourceAsStream(String name)

Overrides java.lang.ClassLoader.getResourceAsStream.

Doc from java.lang.ClassLoader.getResourceAsStream.

Returns an input stream for reading the specified resource.

The search order is described in the documentation for getResource(String).

Resources in named modules are subject to the encapsulation rules specified by Module.getResourceAsStream. Additionally, and except for the special case where the resource has a name ending with ".class", this method will only find resources in packages of named modules when the package is opened unconditionally.

Parameters
name:String

The resource name

Returns:InputStream

An input stream for reading the resource; null if the resource could not be found, the resource is in a package that is not opened unconditionally, or access to the resource is denied by the security manager.

Annotations
@Override
getResourcesback to summary
public Enumeration<URL> getResources(String name) throws IOException

Overrides java.lang.ClassLoader.getResources.

Doc from java.lang.ClassLoader.getResources.

Finds all the resources with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.

The name of a resource is a /-separated path name that identifies the resource.

Resources in named modules are subject to the encapsulation rules specified by Module.getResourceAsStream. Additionally, and except for the special case where the resource has a name ending with ".class", this method will only find resources in packages of named modules when the package is opened unconditionally (even if the caller of this method is in the same module as the resource).

Parameters
name:String

The resource name

Returns:Enumeration<URL>

An enumeration of URL objects for the resource. If no resources could be found, the enumeration will be empty. Resources for which a URL cannot be constructed, are in a package that is not opened unconditionally, or access to the resource is denied by the security manager, are not returned in the enumeration.

Annotations
@Override
Exceptions
IOException:
If I/O errors occur
loadClassback to summary
public Class<?> loadClass(String name) throws ClassNotFoundException

Overrides java.lang.ClassLoader.loadClass.

Doc from java.lang.ClassLoader.loadClass.

Loads the class with the specified binary name. This method searches for classes in the same manner as the loadClass(String, boolean) method. It is invoked by the Java virtual machine to resolve class references. Invoking this method is equivalent to invoking loadClass(name, false).

Parameters
name:String

The binary name of the class

Returns:Class<?>

The resulting Class object

Annotations
@Override
Exceptions
ClassNotFoundException:
If the class was not found