org.apache.openjpa.util
Class MultiLoaderClassResolver

java.lang.Object
  extended by org.apache.openjpa.util.MultiLoaderClassResolver
All Implemented Interfaces:
ClassResolver

public class MultiLoaderClassResolver
extends Object
implements ClassResolver

A simple ClassResolver that uses multiple class loaders to resolve classes.

Author:
Steve Kim

Constructor Summary
MultiLoaderClassResolver()
           
MultiLoaderClassResolver(ClassLoader[] loaders)
           
 
Method Summary
 boolean addClassLoader(ClassLoader loader)
           
 ClassLoader getClassLoader(Class ctx, ClassLoader envLoader)
          Return a class loader that can be used to load classes and resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiLoaderClassResolver

public MultiLoaderClassResolver()

MultiLoaderClassResolver

public MultiLoaderClassResolver(ClassLoader[] loaders)
Method Detail

addClassLoader

public boolean addClassLoader(ClassLoader loader)

getClassLoader

public ClassLoader getClassLoader(Class ctx,
                                  ClassLoader envLoader)
Description copied from interface: ClassResolver
Return a class loader that can be used to load classes and resources. This can be a standard class loader, or a customized loader such as a MultiClassLoader.

Specified by:
getClassLoader in interface ClassResolver
Parameters:
ctx - the context class; may be null if no context class
envLoader - the thread's context class loader when the persistence environment (i.e. broker) was obtained; may be null if operating outside the context of persistence environment


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.