org.apache.openejb
Class ClassLoaderUtil
java.lang.Object
org.apache.openejb.ClassLoaderUtil
public class ClassLoaderUtil
- extends Object
- Version:
- $Revision: 1230327 $ $Date: 2012-01-11 15:42:20 -0800 (Wed, 11 Jan 2012) $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassLoaderUtil
public ClassLoaderUtil()
getContextClassLoader
public static ClassLoader getContextClassLoader()
getUrlCachedName
public static File getUrlCachedName(String appId,
URL url)
isUrlCached
public static boolean isUrlCached(String appId,
URL url)
getUrlKeyCached
public static URL getUrlKeyCached(String appId,
File file)
createClassLoader
public static URLClassLoader createClassLoader(String appId,
URL[] urls,
ClassLoader parent)
destroyClassLoader
public static void destroyClassLoader(ClassLoader classLoader)
- Destroy a classloader as forcefully as possible.
- Parameters:
classLoader - ClassLoader to destroy.
finalizeNativeLibs
public boolean finalizeNativeLibs(ClassLoader cl)
destroyClassLoader
public static void destroyClassLoader(String appId)
createTempClassLoader
public static URLClassLoader createTempClassLoader(ClassLoader parent)
createTempClassLoader
public static URLClassLoader createTempClassLoader(String appId,
URL[] urls,
ClassLoader parent)
clearClassLoaderCaches
public static void clearClassLoaderCaches()
- Cleans well known class loader leaks in VMs and libraries. There is a lot of bad code out there and this method
will clear up the know problems. This method should only be called when the class loader will no longer be used.
It this method is called two often it can have a serious impact on preformance.
clearSunJarFileFactoryCache
public static void clearSunJarFileFactoryCache(String jarLocation)
clearSunSoftCache
public static void clearSunSoftCache(Class clazz,
String fieldName)
- Clears the caches maintained by the SunVM object stream implementation.
This method uses reflection and setAccessable to obtain access to the Sun cache.
The cache Class synchronizes upon itself for access to the cache Map.
This method completely clears the class loader cache which will impact preformance of object serialization.
- Parameters:
clazz - the name of the class containing the cache fieldfieldName - the name of the cache field
cleanOpenJPACache
public static void cleanOpenJPACache(ClassLoader classLoader)
Copyright © 1999-2012 The Apache Software Foundation. All Rights Reserved.