org.tinygroup.jspengine.appserv
类 ClassLoaderUtil

java.lang.Object
  继承者 org.tinygroup.jspengine.appserv.ClassLoaderUtil

public class ClassLoaderUtil
extends Object

Provides utility functions related to URLClassLoaders or subclasses of it. W A R N I N G This class uses undocumented, unpublished, private data structures inside java.net.URLClassLoader and sun.misc.URLClassPath. Use with extreme caution.

作者:
tjquinn

构造方法摘要
ClassLoaderUtil()
           
 
方法摘要
static void releaseLoader(URLClassLoader classLoader)
          Releases resources held by the URLClassLoader.
static IOException[] releaseLoader(URLClassLoader classLoader, Vector<String> jarsClosed)
          Releases resources held by the URLClassLoader.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ClassLoaderUtil

public ClassLoaderUtil()
方法详细信息

releaseLoader

public static void releaseLoader(URLClassLoader classLoader)
Releases resources held by the URLClassLoader. Notably, close the jars opened by the loader. This does not prevent the class loader from continuing to return classes it has already resolved.

参数:
classLoader - the instance of URLClassLoader (or a subclass)

releaseLoader

public static IOException[] releaseLoader(URLClassLoader classLoader,
                                          Vector<String> jarsClosed)
Releases resources held by the URLClassLoader. Notably, close the jars opened by the loader. This does not prevent the class loader from continuing to return classes it has alrady resolved although that is not what we intend to happen. Initializes and updates the Vector of jars that have been successfully closed.

Any errors are logged.

参数:
classLoader - the instance of URLClassLoader (or a subclass)
jarsClosed - a Vector of Strings that will contain the names of jars successfully closed; can be null if the caller does not need the information returned
返回:
array of IOExceptions reporting jars that failed to close; null indicates that an error other than an IOException occurred attempting to release the loader; empty indicates a successful release; non-empty indicates at least one error attempting to close an open jar.


Copyright © 2006–2014 开源组织. All rights reserved.