|
|||||||
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.jibx.binding.Loader
Binding classloader. This is intended to substitute for the System classloader (i.e., the one used for loading user classes). It first processes one or more binding definitions, caching the binary classes modified by the bindings. It then uses these modified forms of the classes when they're requested for loading.
Nested Class Summary | |
static class |
Loader.NondelegatingLoader
Version of bind-on-demand loader which will not delegate handling of classes included in the binding definition. |
Nested classes inherited from class java.lang.ClassLoader |
|
Field Summary | |
private java.util.ArrayList |
m_bindings
Binding definitions used by loader. |
private java.util.HashMap |
m_classMap
Map of classes modified by binding. |
private boolean |
m_isBound
Flag for bindings compiled into class code. |
Fields inherited from class java.net.URLClassLoader |
|
Fields inherited from class java.security.SecureClassLoader |
|
Fields inherited from class java.lang.ClassLoader |
|
Constructor Summary | |
Loader()
Default constructor. |
|
Loader(java.net.URL[] paths)
Constructor with classpath URLs supplied. |
|
Loader(java.net.URL[] paths,
java.lang.ClassLoader parent)
Constructor with classpath URLs and parent classloader supplied. |
Method Summary | |
protected java.lang.Class |
findClass(java.lang.String name)
Find and load class by name. |
static java.net.URL[] |
getClassPaths()
Method builds an array of URL for items in the class path. |
protected boolean |
isBoundClass(java.lang.String name)
Check if a class has been modified by a binding. |
void |
loadBinding(java.lang.String fname,
java.lang.String sname,
java.io.InputStream is,
java.net.URL url)
Load binding definition. |
void |
loadFileBinding(java.lang.String path)
Load binding definition from file path. |
void |
loadResourceBinding(java.lang.String path)
Load binding definition from file path. |
void |
processBindings()
Process the binding definitions. |
void |
reset()
Reset loader information. |
Methods inherited from class java.net.URLClassLoader |
addURL, definePackage, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
defineClass |
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, 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 |
Field Detail |
private java.util.ArrayList m_bindings
private boolean m_isBound
private java.util.HashMap m_classMap
Constructor Detail |
public Loader(java.net.URL[] paths, java.lang.ClassLoader parent)
paths
- array of classpath URLsparent
- classloader used for delegation loadingpublic Loader(java.net.URL[] paths)
paths
- array of classpath URLspublic Loader() throws java.net.MalformedURLException
java.net.MalformedURLException
- on error in classpath URLsMethod Detail |
public void reset()
public static java.net.URL[] getClassPaths() throws java.net.MalformedURLException
java.net.MalformedURLException
public void loadBinding(java.lang.String fname, java.lang.String sname, java.io.InputStream is, java.net.URL url) throws JiBXException, java.io.IOException
fname
- binding definition full namesname
- short form of name to use as the default name of the bindingis
- input stream for binding definition documenturl
- URL for binding definition (null
if not
available)
java.lang.IllegalStateException
- if called after bindings have been
compiled
java.io.IOException
- if error reading the binding
JiBXException
- if error in processing the binding definitionpublic void loadFileBinding(java.lang.String path) throws JiBXException, java.io.IOException
path
- binding definition file path
java.lang.IllegalStateException
- if called after bindings have been
compiled
java.io.IOException
- if error reading the file
JiBXException
- if error in processing the binding definitionpublic void loadResourceBinding(java.lang.String path) throws JiBXException, java.io.IOException
path
- binding definition file path
java.lang.IllegalStateException
- if called after bindings have been
compiled
java.io.IOException
- if error reading the file
JiBXException
- if error in processing the binding definitionpublic void processBindings() throws JiBXException
JiBXException
- if error in processing the binding definitionprotected boolean isBoundClass(java.lang.String name)
name
- fully qualified package and class name to be found
true
if class modified by binding,
false
if notprotected java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundException
name
- fully qualified package and class name to be found
java.lang.ClassNotFoundException
- if the class cannot be foundClassLoader.findClass(java.lang.String)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |