|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ClassLoader
org.jboss.aop.standalone.SystemClassLoader
A classloader that can be installed as the system classloader to enable aop translation based on files in META-INF/jboss-aop.xml in the classpath.
You will need the following jars in your classpath (log4j.jar is optional):
java -Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader my.MainImplementation Detail: All access to non-jre classes must be done through reflection the classes must be loaded using the loadLocally method.
Constructor Summary | |
SystemClassLoader(ClassLoader parent)
Construct a new system classloader. |
Method Summary | |
Class |
defineClassFromBytes(String name,
byte[] b,
boolean resolve)
Define a class from the bytes |
protected void |
definePackage(String className)
Define the package for the class if not already done |
protected void |
initialize()
Initialize the aspect manager and load the static aspects |
protected void |
install()
Install the classloader, get reflection objects and load classes using ourself. |
Class |
loadClass(String name,
boolean resolve)
Load a class, overridden to transform aop enhanced classes and load non jre classes through this classloader. |
protected Class |
loadClassByDelegation(String name)
Load jre classes from the parent classloader |
protected byte[] |
loadClassBytes(String name)
Load the bytecode for a class |
protected Class |
loadClassLocally(String name)
Load a class using this classloader only |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SystemClassLoader(ClassLoader parent)
We cannot do much here, we need to avoid recursion
parent
- the default system classloaderMethod Detail |
public Class loadClass(String name, boolean resolve) throws ClassNotFoundException
name
- the class nameresolve
- whether to resolve the class
ClassNotFoundException
- when there is no classprotected byte[] loadClassBytes(String name) throws ClassNotFoundException, IOException
ClassNotFoundException
IOException
public Class defineClassFromBytes(String name, byte[] b, boolean resolve)
b
- the bytecoderesolve
- whether to resolve the classprotected void definePackage(String className)
protected Class loadClassLocally(String name) throws ClassNotFoundException
name
- the class name
ClassNotFoundException
- when there is no classprotected Class loadClassByDelegation(String name) throws ClassNotFoundException
name
- the class name
ClassNotFoundException
- when there is no classprotected void install()
protected void initialize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |