|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.ClassLoader | +--org.objectweb.jac.core.JacLoader
The JAC specific class loader for JAC objects.
This loader does the following things :
WrappeeTranslator
.
WrappeeTranslator
Constructor Summary | |
JacLoader(boolean write,
boolean clean)
Create a JacLoader. |
|
JacLoader(boolean write,
boolean clean,
ClassLoader otherClassLoader)
Create a JacLoader. |
Method Summary | |
protected boolean |
analyzeClass(String classname)
Tells wether a defered class's bytecode should be analyzed |
static boolean |
classIsToBeAdapted(String name)
Tell wether a class is to be adapted or not. |
boolean |
deferClass(String classname)
Tells wether to defer loading of a class to the parent ClassLoader |
static void |
displayClassInfo(String name)
display some information about a class Only use for debug purpose to verify that the class has been patched correctly. |
URL |
getResource(String name)
|
InputStream |
getResourceAsStream(String name)
|
boolean |
isLoaded(String classname)
Returns true if the class is already loaded. |
protected Class |
loadClass(String class_name,
boolean resolve)
|
static void |
main(String[] args)
Usage: java org.objectweb.jac.core.JacLoader [class] |
void |
readProperties(Properties props)
Use JacPropLoader to read some JAC properties |
void |
run(String classname,
String[] args)
Loads a class and calls main() in that class.
|
void |
setWrappeeTranslator(WrappeeTranslator wt)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JacLoader(boolean write, boolean clean, ClassLoader otherClassLoader) throws Exception
write
- if true, caches the tranlated classes on diskclean
- if true, clears the disk cacheotherClassLoader
- if not null, indicates another
ClassLoader where to search for classes not in original
ClassPathpublic JacLoader(boolean write, boolean clean) throws Exception
JacLoader(boolean,boolean,null)
.
write
- if true, caches the tranlated classes on diskclean
- if true, clears the disk cacheMethod Detail |
public void setWrappeeTranslator(WrappeeTranslator wt)
public boolean deferClass(String classname)
classname
- name of the class
protected boolean analyzeClass(String classname)
classname
- the name of the classprotected Class loadClass(String class_name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public InputStream getResourceAsStream(String name)
getResourceAsStream
in class ClassLoader
public URL getResource(String name)
getResource
in class ClassLoader
public static boolean classIsToBeAdapted(String name)
name
- a String
value
boolean
value (true if to be adpated).JacPropLoader
,
JacPropTools
public static void displayClassInfo(String name)
name
- the class to displayClassLoader
public boolean isLoaded(String classname)
classname
- the class name to test
public void run(String classname, String[] args) throws Throwable
main()
in that class.
This method was extracted "as is" from javassist 1.0 from Shigeru Chiba.
classname
- the loaded class.args
- parameters passed to main()
.
Throwable
public void readProperties(Properties props)
props
- the properties to readpublic static void main(String[] args) throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |