org.apache.openejb
Class ClassLoaderUtil

java.lang.Object
  extended by org.apache.openejb.ClassLoaderUtil

public class ClassLoaderUtil
extends Object

Version:
$Revision: 948987 $ $Date: 2010-05-27 22:55:12 +0200 (Do, 27. Mai 2010) $

Constructor Summary
ClassLoaderUtil()
           
 
Method Summary
static void cleanOpenJPACache(ClassLoader classLoader)
           
static void clearClassLoaderCaches()
          Cleans well known class loader leaks in VMs and libraries.
static void clearSunJarFileFactoryCache(String jarLocation)
           
static void clearSunSoftCache(Class clazz, String fieldName)
          Clears the caches maintained by the SunVM object stream implementation.
static URLClassLoader createClassLoader(String appId, URL[] urls, ClassLoader parent)
           
static URLClassLoader createTempClassLoader(ClassLoader parent)
           
static URLClassLoader createTempClassLoader(String appId, URL[] urls, ClassLoader parent)
           
static void destroyClassLoader(ClassLoader classLoader)
           
static void destroyClassLoader(String appId)
           
static ClassLoader getContextClassLoader()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderUtil

public ClassLoaderUtil()
Method Detail

getContextClassLoader

public static ClassLoader getContextClassLoader()

createClassLoader

public static URLClassLoader createClassLoader(String appId,
                                               URL[] urls,
                                               ClassLoader parent)

destroyClassLoader

public static void destroyClassLoader(ClassLoader classLoader)

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 is locked with a synchronize monitor and cleared. 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 field
fieldName - the name of the cache field

cleanOpenJPACache

public static void cleanOpenJPACache(ClassLoader classLoader)


Copyright © 1999-2013 The Apache OpenEJB development community. All Rights Reserved.