Skip to content
This repository has been archived by the owner on May 3, 2018. It is now read-only.

Commit

Permalink
Add/make public methods to load classes and resources from a specific…
Browse files Browse the repository at this point in the history
… module class loader (without dependencies)
  • Loading branch information
dmlloyd committed Jan 31, 2013
1 parent 42199ad commit 98b80fd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/org/jboss/modules/ModuleClassLoader.java
Expand Up @@ -190,6 +190,17 @@ protected final Class<?> findClass(String className, boolean exportsOnly, final
throw new ClassNotFoundException(className + " from [" + module + "]");
}

/**
* Load a class from this class loader.
*
* @param className the class name to load
* @return the loaded class or {@code null} if it was not found
* @throws ClassNotFoundException if an exception occurs while loading the class or its dependencies
*/
public Class<?> loadClassLocal(String className) throws ClassNotFoundException {
return loadClassLocal(className, false);
}

/**
* Load a local class from this class loader.
*
Expand All @@ -198,7 +209,7 @@ protected final Class<?> findClass(String className, boolean exportsOnly, final
* @return the loaded class or {@code null} if it was not found
* @throws ClassNotFoundException if an error occurs while loading the class
*/
Class<?> loadClassLocal(final String className, final boolean resolve) throws ClassNotFoundException {
public Class<?> loadClassLocal(final String className, final boolean resolve) throws ClassNotFoundException {
final ModuleLogger log = Module.log;
final Module module = this.module;
log.trace("Finding local class %s from %s", className, module);
Expand Down Expand Up @@ -301,7 +312,7 @@ Resource loadResourceLocal(final String root, final String name) {
* @param name the resource name
* @return the list of resources
*/
List<Resource> loadResourceLocal(final String name) {
public List<Resource> loadResourceLocal(final String name) {
final Map<String, List<ResourceLoader>> paths = this.paths.getAllPaths();

final String path = Module.pathOf(name);
Expand Down

0 comments on commit 98b80fd

Please sign in to comment.