Class AbstractClassGenerator.ClassLoaderData

java.lang.Object
net.sf.cglib.core.AbstractClassGenerator.ClassLoaderData
Enclosing class:
AbstractClassGenerator<T>

protected static class AbstractClassGenerator.ClassLoaderData extends Object
  • Field Details

    • reservedClassNames

      private final Set<String> reservedClassNames
    • generatedClasses

      private final LoadingCache<AbstractClassGenerator,Object,Object> generatedClasses
      AbstractClassGenerator here holds "cache key" (e.g. Enhancer configuration), and the value is the generated class plus some additional values (see AbstractClassGenerator.unwrapCachedValue(Object).

      The generated classes can be reused as long as their classloader is reachable.

      Note: the only way to access a class is to find it through generatedClasses cache, thus the key should not expire as long as the class itself is alive (its classloader is alive).

    • classLoader

      private final WeakReference<ClassLoader> classLoader
      Note: ClassLoaderData object is stored as a value of WeakHashMap<ClassLoader, ...> thus this classLoader reference should be weak otherwise it would make classLoader strongly reachable and alive forever. Reference queue is not required since the cleanup is handled by WeakHashMap.
    • uniqueNamePredicate

      private final Predicate uniqueNamePredicate
    • GET_KEY

      private static final Function<AbstractClassGenerator,Object> GET_KEY
  • Constructor Details

    • ClassLoaderData

      public ClassLoaderData(ClassLoader classLoader)
  • Method Details