java.lang.Object
java.lang.ClassLoader
com.chaoswg.xtc4y.classloaders.LogClassLoader
- public class LogClassLoader
- extends java.lang.ClassLoader
This is a classloader appending to every implemented method a begin
and end log message of the level DEBUG using log4j. The log4j framework
may be configured using the following the system property
'log4j.configuration', i.e. starting the application with
java -Dlog4j.configuration=foobar.properties com.athome.myclass
| Nested classes inherited from class java.lang.ClassLoader |
|
| Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getLogger
private com.chaoswg.xtc4y.classdesc.MethodrefCPEntry getLogger
debug
private com.chaoswg.xtc4y.classdesc.code.instructions.InvokeVirtual debug
outRef
private com.chaoswg.xtc4y.classdesc.FieldrefCPEntry outRef
writeGeneratedFile
private boolean writeGeneratedFile
cached
private java.util.HashMap cached
PROHIBITED_PCKG
private static final java.lang.String[] PROHIBITED_PCKG
LOG4J_PKG
private static final java.lang.String LOG4J_PKG
- See Also:
- Constant Field Values
LogClassLoader
public LogClassLoader()
loadClass
protected java.lang.Class loadClass(java.lang.String name,
boolean resolve)
throws java.lang.ClassNotFoundException
- Overwrite default loadClass behaviour. Instead of first delegating to
find the class through the parent classloader, try to load it through
this classloader
findClass
protected java.lang.Class findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
- Find a class by name
appendLogMessage
private void appendLogMessage(com.chaoswg.xtc4y.classdesc.MethodInfo method,
java.lang.String className,
com.chaoswg.xtc4y.classdesc.FieldrefCPEntry field)
- Append a log message to a method
writeClassFile
private void writeClassFile(byte[] bytes,
java.lang.String name)
throws java.io.IOException
- Write an array of bytes into an output file