diff --git a/src/main/java/emissary/util/ClassLookupCache.java b/src/main/java/emissary/util/ClassLookupCache.java index c4c20d634c..49131b6beb 100644 --- a/src/main/java/emissary/util/ClassLookupCache.java +++ b/src/main/java/emissary/util/ClassLookupCache.java @@ -140,6 +140,13 @@ public static Class lookup(final String className) throws ClassNotFoundExcept } } + /** + * Destroy the ThreadLocal cache object + */ + public static void unload() { + cachedLookupResult.remove(); + } + /** This is a static utility class, so prevent instantiation. */ private ClassLookupCache() {} } diff --git a/src/main/java/emissary/util/ConstructorLookupCache.java b/src/main/java/emissary/util/ConstructorLookupCache.java index d411b32c2d..7706831ed2 100644 --- a/src/main/java/emissary/util/ConstructorLookupCache.java +++ b/src/main/java/emissary/util/ConstructorLookupCache.java @@ -256,6 +256,13 @@ public static Constructor lookup(final Class clazz, final Class[] argTy } } + /** + * Destroy the ThreadLocal cache object + */ + public static void unload() { + cachedConstructorLookup.remove(); + } + /** This is a static utility class, so prevent instantiation. */ private ConstructorLookupCache() {} } diff --git a/src/main/java/emissary/util/io/FileManipulator.java b/src/main/java/emissary/util/io/FileManipulator.java index f785b21cdf..eff6d56c0a 100755 --- a/src/main/java/emissary/util/io/FileManipulator.java +++ b/src/main/java/emissary/util/io/FileManipulator.java @@ -1,7 +1,3 @@ -/* - $Id$ - */ - package emissary.util.io; import java.io.File; @@ -11,8 +7,6 @@ /** * A class of utility methods for manipulating files. */ - - public class FileManipulator implements Serializable { static final long serialVersionUID = 365259266882118692L; @@ -54,6 +48,13 @@ public static String mkTempFile(final String dirPath) { return mkTempFile(dirPath, "temp"); } + /** + * Destroy the ThreadLocal SecureRandom object + */ + public static void unload() { + secureRandomThreadLocal.remove(); + } + /** This class is not meant to be instantiated. */ private FileManipulator() {} }