Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.chaoswg.xtc4y.classloaders
Class LogClassLoader  view LogClassLoader download LogClassLoader.java

java.lang.Object
  extended byjava.lang.ClassLoader
      extended bycom.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 Class Summary
 
Nested classes inherited from class java.lang.ClassLoader
 
Field Summary
private  java.util.HashMap cached
           
private  com.chaoswg.xtc4y.classdesc.code.instructions.InvokeVirtual debug
           
private  com.chaoswg.xtc4y.classdesc.MethodrefCPEntry getLogger
           
private static java.lang.String LOG4J_PKG
           
private  com.chaoswg.xtc4y.classdesc.FieldrefCPEntry outRef
           
private static java.lang.String[] PROHIBITED_PCKG
           
private  boolean writeGeneratedFile
           
 
Fields inherited from class java.lang.ClassLoader
 
Constructor Summary
LogClassLoader()
           
 
Method Summary
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
protected  java.lang.Class findClass(java.lang.String name)
          Find a class by name
protected  java.lang.Class loadClass(java.lang.String name, boolean resolve)
          Overwrite default loadClass behaviour.
private  void writeClassFile(byte[] bytes, java.lang.String name)
          Write an array of bytes into an output file
 
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
 

Field Detail

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
Constructor Detail

LogClassLoader

public LogClassLoader()
Method Detail

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