|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.iids.aos.agentserver.java.JavaAgentRunner.MyURLClassLoader
@Deprecated public static class JavaAgentRunner.MyURLClassLoader
Our own version of URLClassLoader with one extra function: public void close(); This will close all underlying JarFiles, which the original URLClassLoader keeps open, so you could run out of file descriptors when running many agents, and Windows will not delete open files. Note: Java JDK7 will extend URLClassLoader with its own close() so this class will not be necessary then. http://blogs.sun.com/CoreJavaTechTips/entry/closing_a_urlclassloader See: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014 Where this code originates. Note: Closing the file may cause IllegalStateExceptions: zipfile closed when the URLClassLoader tries to reload classes. It seems that the class may not be in this jarfile, but the fact it throws an exception causes the classloading algorithm to fail. So we need to catch this exception and deal with it. We can either reopen the original jar-file (if it still exists) or open another (empty) jarfile.
| Constructor Summary | |
|---|---|
JavaAgentRunner.MyURLClassLoader(java.net.URL[] urls)
Deprecated. |
|
JavaAgentRunner.MyURLClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
Deprecated. |
|
JavaAgentRunner.MyURLClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent,
java.net.URLStreamHandlerFactory factory)
Deprecated. |
|
| Method Summary | |
|---|---|
void |
close()
Deprecated. Close the underlying zipfile. |
java.net.URL |
findResource(java.lang.String name)
Deprecated. Overriding the findResource mechanism. |
| Methods inherited from class java.net.URLClassLoader |
|---|
addURL, definePackage, findClass, findResources, getPermissions, getURLs, newInstance, newInstance |
| Methods inherited from class java.security.SecureClassLoader |
|---|
defineClass, defineClass |
| Methods inherited from class java.lang.ClassLoader |
|---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaAgentRunner.MyURLClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent,
java.net.URLStreamHandlerFactory factory)
public JavaAgentRunner.MyURLClassLoader(java.net.URL[] urls)
public JavaAgentRunner.MyURLClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
| Method Detail |
|---|
public java.net.URL findResource(java.lang.String name)
findResource in class java.net.URLClassLoadername - class to find
public void close()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||