org.sourceforge.jemm.weaver.transformation
Class ClassPoolFactory

java.lang.Object
  extended by org.sourceforge.jemm.weaver.transformation.ClassPoolFactory

public final class ClassPoolFactory
extends java.lang.Object

A factory for the ClassPool class from Javassist which makes it easy to throw away the old ones and create a new one. This functionality is needed due to the design of the ClassPool class which holds onto CtClass instances. The factory has the functionality to only throw away the cached values every 20 classes which may improve performance without consuming too much RAM.

Author:
Method Summary
static void clearPool()
          Clears the pool but only once this method has been called ITERATIONS_TO_KEEP times.
static javassist.ClassPool createNewPool()
          Creates a new ClassPool and returns the result.
static javassist.ClassPool getPool()
          Returns the current ClassPool if there is one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPool

public static javassist.ClassPool getPool()
Returns the current ClassPool if there is one.

Returns:
The current class pool instance.

createNewPool

public static javassist.ClassPool createNewPool()
Creates a new ClassPool and returns the result.

Returns:
The classPool created.

clearPool

public static void clearPool()
Clears the pool but only once this method has been called ITERATIONS_TO_KEEP times.



Copyright © 2009. All Rights Reserved.