Java Doc for QuiltClassLoader.java in  » Test-Coverage » Quilt » org » quilt » cl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Test Coverage » Quilt » org.quilt.cl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.net.URLClassLoader
   org.quilt.cl.QuiltClassLoader

QuiltClassLoader
public class QuiltClassLoader extends URLClassLoader (Code)

Quilt's transforming class loader. Can be directed to instrument a set of classes, matching class names against a list of prefixes and another list excluding classes from instrumentation, the exclusion list taking priority. Will delegate loading to a parent class loader where explicitly directed to; otherwise will be the defining loader. By default the loading of classes whose names begin with java., javax., junit., org.apache.bcel., org.apache.tools.ant. and org.quilt. is delegated.

Classes whose names begin with a reserved prefix, currently test.data.Test, are synthesized instead of being loaded. This must be specifically enabled.


author:
   Jim Dixon
See Also:   ClassFactory


Field Summary
final public static  charCLASSPATH_DELIM_CHAR
    
final public static  StringCLASSPATH_DELIM_STR
    
final public static  String[]DELEGATED
     Names of classes which must be loaded by the parent.
final public static  charFILE_PATH_DELIM_CHAR
    
final public static  StringFILE_PATH_DELIM_STR
    
final public static  StringSYNTH_PREFIX
     Prefix indicating that the class should be synthesized.
final public static  StringTHIS_DIR
     Convert domain name in classpath to file name, allowing for initial dots.
final public static  intTHIS_DIR_LEN
    
final public static  StringUP_DIR
    
final public static  intUP_DIR_LEN
    
 Listcxf
     Configurable class transformers.
 Listgxf
     Configurable graph transformers.
 Listmxf
     Configurable method transformers.
 ListregList
     QuiltRegistry list.
public  MapregMap
     Map of registries by String name.
public  ClassTransformerxformer
     Responsible for instrumenting classes.

Constructor Summary
public  QuiltClassLoader(URL[] cp, String[] inc)
     Constructor with abbreviated argument list.
public  QuiltClassLoader(URL[] cp, ClassLoader parent, String[] del, String[] inc, String[] exc)
     Constructor with full argument list.

Method Summary
public  voidaddClassXformer(ClassXformer xf)
     Add a class transformer.
public  voidaddDelegated(String prefix)
     Add a class name prefix to the list of those to be delegated to the parent.
public  voidaddExcluded(String prefix)
     Add a class name prefix to the list of those to be excluded from instrumentation.
public  voidaddGraphXformer(GraphXformer xf)
     Add a graph transformer.
public  voidaddIncluded(String prefix)
     Add a class name prefix to the list of those to be instrumented.
public  voidaddMethodXformer(MethodXformer xf)
     Add a method transformer.
public  voidaddPath(URL url)
     Add a path to the class loader's classpath.
public  QuiltRegistryaddQuiltRegistry(String regName)
     Add a new QuiltRegistry to the list.
public static  StringclassFileName(String className)
     Convert a class name into a file name by replacing dots with forward slashes and appending ".class".
public static  URL[]cpToURLs(String cp)
    
public static  StringdomainToFileName(String name)
    
protected  ClassfindClass(String name)
     Locate the class whose name is passed and define it.
protected  byte[]getClassData(String className)
     Find a class along the class path and load it as a byte array.
public  URL[]getClassPath()
     The classpath used by this QuiltClassLoader.
public  String[]getDelegated()
    
public  String[]getExcluded()
    
public  String[]getIncluded()
    
public  QuiltRegistrygetRegistry(String regName)
     Get a reference to a Quilt registry.
public  StringgetReport()
     Get reports from any or all registries.
public  booleangetSynthEnabled()
     Get synthesizing-enabled flag.
public  StringgetSynthPrefix()
    
public synchronized  ClassloadClass(String name)
     Class loader.
public  voidsetClassPath(String cp)
     Convert classpath in normal form to URL[] and sets loader classpath to the corresponding value.
public  voidsetExcluded(String s)
     Sets the list of classes to be excluded from instrumentation.
public  voidsetIncluded(String s)
     Sets the list of classes to be instrumented.
public  voidsetSynthEnabled(boolean b)
     Enable class synthesizing.
public  StringurlsToString()
     Classpath as a newline-terminated String.

Field Detail
CLASSPATH_DELIM_CHAR
final public static char CLASSPATH_DELIM_CHAR(Code)



CLASSPATH_DELIM_STR
final public static String CLASSPATH_DELIM_STR(Code)



DELEGATED
final public static String[] DELEGATED(Code)
Names of classes which must be loaded by the parent. There is one exception to this list: org.quilt.QIC, which is not delegated and not instrumented.



FILE_PATH_DELIM_CHAR
final public static char FILE_PATH_DELIM_CHAR(Code)
Operating system specific



FILE_PATH_DELIM_STR
final public static String FILE_PATH_DELIM_STR(Code)



SYNTH_PREFIX
final public static String SYNTH_PREFIX(Code)
Prefix indicating that the class should be synthesized.



THIS_DIR
final public static String THIS_DIR(Code)
Convert domain name in classpath to file name, allowing for initial dots. Need to cope with ../../target/big.jar and similar constructions.



THIS_DIR_LEN
final public static int THIS_DIR_LEN(Code)



UP_DIR
final public static String UP_DIR(Code)



UP_DIR_LEN
final public static int UP_DIR_LEN(Code)



cxf
List cxf(Code)
Configurable class transformers.



gxf
List gxf(Code)
Configurable graph transformers.



mxf
List mxf(Code)
Configurable method transformers.



regList
List regList(Code)
QuiltRegistry list.



regMap
public Map regMap(Code)
Map of registries by String name.



xformer
public ClassTransformer xformer(Code)
Responsible for instrumenting classes.




Constructor Detail
QuiltClassLoader
public QuiltClassLoader(URL[] cp, String[] inc)(Code)
Constructor with abbreviated argument list.



QuiltClassLoader
public QuiltClassLoader(URL[] cp, ClassLoader parent, String[] del, String[] inc, String[] exc)(Code)
Constructor with full argument list.
Parameters:
  cp - Class path, an array of paths
Parameters:
  parent - Class loader which we delegate to.
Parameters:
  del - String array, names of classes to be delegated
Parameters:
  inc - String array, names of classes to be instrumented
Parameters:
  exc - String array, names of classes not to be instrumented.




Method Detail
addClassXformer
public void addClassXformer(ClassXformer xf)(Code)
Add a class transformer.



addDelegated
public void addDelegated(String prefix)(Code)
Add a class name prefix to the list of those to be delegated to the parent.
Parameters:
  prefix - Prefix to be added.



addExcluded
public void addExcluded(String prefix)(Code)
Add a class name prefix to the list of those to be excluded from instrumentation.
Parameters:
  prefix - Prefix to be added.



addGraphXformer
public void addGraphXformer(GraphXformer xf)(Code)
Add a graph transformer.



addIncluded
public void addIncluded(String prefix)(Code)
Add a class name prefix to the list of those to be instrumented.
Parameters:
  prefix - Prefix to be added.



addMethodXformer
public void addMethodXformer(MethodXformer xf)(Code)
Add a method transformer.



addPath
public void addPath(URL url)(Code)
Add a path to the class loader's classpath.
Parameters:
  url - Path to be added.



addQuiltRegistry
public QuiltRegistry addQuiltRegistry(String regName)(Code)
Add a new QuiltRegistry to the list. An example of the argument is "org.quilt.cover.stmt.StmtRegistry".
Parameters:
  regName - The domain name of the registry in dotted form.



classFileName
public static String classFileName(String className)(Code)
Convert a class name into a file name by replacing dots with forward slashes and appending ".class".



cpToURLs
public static URL[] cpToURLs(String cp)(Code)
Convert classpath in normal form to URL[]



domainToFileName
public static String domainToFileName(String name)(Code)
Convert a dotted domain name to its path form, allowing for leading ./ and ../ and terminating .jar



findClass
protected Class findClass(String name) throws ClassNotFoundException(Code)
Locate the class whose name is passed and define it. If the class name has the appropriate prefix and synthesizing it is enabled, it synthesizes it. Otherwise it searches for it along the class path. If indicated, it transforms (instruments) the class. Finally, it defines and returns the result.
Parameters:
  name - Class name in embedded dot (.) form.



getClassData
protected byte[] getClassData(String className) throws IOException(Code)
Find a class along the class path and load it as a byte array.



getClassPath
public URL[] getClassPath()(Code)
The classpath used by this QuiltClassLoader.



getDelegated
public String[] getDelegated()(Code)
As a String array the list of class name prefixeswhose loading is to be delegated to the parent.



getExcluded
public String[] getExcluded()(Code)
As a String array the list of class name prefixeswhich are NOT to be instrumented.



getIncluded
public String[] getIncluded()(Code)
As a String array the list of class name prefixeswhich ARE to be instrumented.



getRegistry
public QuiltRegistry getRegistry(String regName)(Code)
Get a reference to a Quilt registry.



getReport
public String getReport()(Code)
Get reports from any or all registries. XXX This should not be returning a String -- it might be huge.



getSynthEnabled
public boolean getSynthEnabled()(Code)
Get synthesizing-enabled flag.



getSynthPrefix
public String getSynthPrefix()(Code)
The prefix signifying that a class is to be synthesized.



loadClass
public synchronized Class loadClass(String name) throws ClassNotFoundException(Code)
Class loader. Delegates the loading if specifically instructed to do so. Returns the class if it has already been loaded. Otherwise creates a class transformer if necessary and then passes the name to findClass.



setClassPath
public void setClassPath(String cp)(Code)
Convert classpath in normal form to URL[] and sets loader classpath to the corresponding value.
Parameters:
  cp - Class path in colon- or semicolon-delimited form.



setExcluded
public void setExcluded(String s)(Code)
Sets the list of classes to be excluded from instrumentation.
Parameters:
  s - List of classes in comma-separated String form.



setIncluded
public void setIncluded(String s)(Code)
Sets the list of classes to be instrumented.
Parameters:
  s - List of classes in comma-separated String form.



setSynthEnabled
public void setSynthEnabled(boolean b)(Code)
Enable class synthesizing.



urlsToString
public String urlsToString()(Code)
Classpath as a newline-terminated String.



Methods inherited from java.net.URLClassLoader
protected void addURL(URL url)(Code)(Java Doc)
protected Package definePackage(String name, Manifest man, URL url) throws IllegalArgumentException(Code)(Java Doc)
protected Class findClass(String name) throws ClassNotFoundException(Code)(Java Doc)
public URL findResource(String name)(Code)(Java Doc)
public Enumeration<URL> findResources(String name) throws IOException(Code)(Java Doc)
protected PermissionCollection getPermissions(CodeSource codesource)(Code)(Java Doc)
public URL[] getURLs()(Code)(Java Doc)
public static URLClassLoader newInstance(URL[] urls, ClassLoader parent)(Code)(Java Doc)
public static URLClassLoader newInstance(URL[] urls)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.