org.curjent.agent
Class CustomLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.curjent.agent.CustomLoader
All Implemented Interfaces:
AgentLoader

public class CustomLoader
extends ClassLoader
implements AgentLoader

Custom class loader. See the class description for AgentLoader.


Constructor Summary
CustomLoader(ClassLoader parent)
          Initializes the ClassLoader super class with the given parent.
 
Method Summary
 Class<?> defineClass(String name, byte[] bytes)
          Calls the super class's defineClass method using an offset of 0 and a length equal to bytes.length.
 ClassLoader getClassLoader()
          Returns this.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomLoader

public CustomLoader(ClassLoader parent)
Initializes the ClassLoader super class with the given parent.

Method Detail

getClassLoader

public ClassLoader getClassLoader()
Returns this.

Specified by:
getClassLoader in interface AgentLoader

defineClass

public Class<?> defineClass(String name,
                            byte[] bytes)
Calls the super class's defineClass method using an offset of 0 and a length equal to bytes.length.

Specified by:
defineClass in interface AgentLoader
Parameters:
name - The class's fully qualified name.
bytes - The generated bytecodes for the class. The offset is 0, and the length is equal to bytes.length.


Copyright 2009-2011 Tom Landon
Apache License 2.0