public class ClassPoolFactory extends Object
This is to ensure that Javassist can locate the classes in various classloading "schemes" - the traditional application classloader used in the CLI client and the JBoss Modules classloading used on the server.
| Modifier and Type | Method and Description |
|---|---|
static javassist.ClassPool |
getClassPool(ClassLoader classLoader)
Returns a class pool that uses the provided class loader as its source for the "class path".
|
static javassist.ClassPool |
getClassPoolForCurrentContextClassLoader()
Unlike the
ClassPool.getDefault() method that only ever returns a single instance of the pool, this
factory may return different instances depending on the context classloader of the current thread. |
public static javassist.ClassPool getClassPool(ClassLoader classLoader)
If the provided class loader is null, a default instance is used.
classLoader - the class loader to return the class pool forpublic static javassist.ClassPool getClassPoolForCurrentContextClassLoader()
ClassPool.getDefault() method that only ever returns a single instance of the pool, this
factory may return different instances depending on the context classloader of the current thread. The returned
class pool is using the current thread context class loader to locate the classes but also is using the default
resource lookup of the Class class, in addition to just the system class path as detected by
Javassist (which is the only one used in the class pool returned by ClassPool.getDefault()).getClassPool(ClassLoader)Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.