|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader java.security.SecureClassLoader java.net.URLClassLoader cuba.wired.DDClassLoader
public class DDClassLoader
Specialized class loader which reads module names from wired-application.xml and tries to locate them in all directories specified in the system class path. This allows to keep the module names themselfs off from the class path which otherwise may become very, very large and potentially can't be expressed on a command line any more. E.g. on Windows systems up to Windows 2000 the maximum length for command lines and environment variables is 1024 characters, causing troubles very soon when working with a large number of separate component modules.
This class loader is supposed to be used only in wired J2SE environments and being specified as an alternative system class loader by system property java.system.class.loader. In managed environments like servlet engines or application servers you should never change the class loader at all. And you hopefully never have to, because the class loaders in these environments are already suitable for large amounts of separate modules.
Constructor Summary | |
---|---|
DDClassLoader(java.lang.ClassLoader parent)
Construct a new DDClassLoader. |
Method Summary | |
---|---|
protected void |
addClasspath()
Add the system class path elements to the URL search list of this loader to let it load as many classes as possible by its own rather then asking its parent. |
protected void |
addModule(java.lang.String moduleName)
Try to locate a module and add it to the loader's URL search list if found. |
java.lang.Class |
loadClass(java.lang.String name)
Overwrites the appropriate method of the base class. |
protected java.lang.String |
locateModule(java.lang.String moduleName)
Try to find a module from one of the directories listed in the system class path. |
protected java.net.URL |
makeURL(java.lang.String moduleLocation)
Make a URL from a file name |
Methods inherited from class java.net.URLClassLoader |
---|
addURL, definePackage, findClass, findResource, 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, 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 DDClassLoader(java.lang.ClassLoader parent) throws InitException
InitException
- if no wired-application.xml can be found or
if it can't be read properly.Method Detail |
---|
protected void addClasspath() throws java.net.MalformedURLException
loadClass(java.lang.String)
why this is reasonable.
java.net.MalformedURLException
protected java.lang.String locateModule(java.lang.String moduleName)
moduleName
- Name of the module as found from wired-application.xml
protected java.net.URL makeURL(java.lang.String moduleLocation) throws java.net.MalformedURLException
java.net.MalformedURLException
protected void addModule(java.lang.String moduleName) throws java.net.MalformedURLException
moduleName
- Name of the module to locate
java.net.MalformedURLException
public java.lang.Class loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |