Java Doc for ProjectClassLoader.java in  » UML » jrefactory » org » acm » seguin » project » 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 » UML » jrefactory » org.acm.seguin.project 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.ClassLoader
      org.acm.seguin.project.ProjectClassLoader

ProjectClassLoader
public class ProjectClassLoader extends ClassLoader (Code)
Used to load classes within ant with a different claspath from that used to start ant. Note that it is possible to force a class into this loader even when that class is on the system classpath by using the forceLoadClass method. Any subsequent classes loaded by that class will then use this loader rather than the system class loader.
author:
   Conor MacNeill
author:
   Jesse Glick
author:
   Magesh Umasankar
author:
   Mike Atkinson
version:
   $Id: ProjectClassLoader.java,v 1.4 2004/03/25 20:24:34 mikeatkinson Exp $
since:
   2.8.01



Constructor Summary
public  ProjectClassLoader(Project project)
     Creates a classloader for the given project.
public  ProjectClassLoader(ClassLoader parent, Project project, boolean parentFirst)
     Creates a classloader for the given project.
Parameters:
  parent - The parent classloader to which unsatisfied loadingattempts are delegated.
public  ProjectClassLoader(Project project, boolean parentFirst)
     Creates a classloader for the given project.
public  ProjectClassLoader(ClassLoader parent, boolean parentFirst)
     Creates an empty class loader.

Method Summary
public  voidaddLoaderPackageRoot(String packageRoot)
     Adds a package root to the list of packages which must be loaded using this loader.
public  voidaddPathElement(String pathElement)
     Adds an element to the classpath to be searched.
Parameters:
  pathElement - The path element to add.
public  voidaddSystemPackageRoot(String packageRoot)
     Adds a package root to the list of packages which must be loaded on the parent loader.
public synchronized  voidcleanup()
     Cleans up any resources held by this classloader.
public  ClassfindClass(String name)
     Searches for and load a class on the classpath of this class loader.
Parameters:
  name - The name of the class to be loaded.
protected  EnumerationfindResources(String name)
     Returns an enumeration of URLs representing all the resources with the given name by searching the class loader's classpath.
Parameters:
  name - The resource name to search for.Must not be null.
public  ClassforceLoadClass(String classname)
     Loads a class through this class loader even if that class is available on the parent classpath. This ensures that any classes which are loaded by the returned class will use this classloader.
Parameters:
  classname - The name of the class to be loaded.Must not be null.
public  ClassforceLoadSystemClass(String classname)
     Loads a class through this class loader but defer to the parent class loader. This ensures that instances of the returned class will be compatible with instances which which have already been loaded on the parent loader.
Parameters:
  classname - The name of the class to be loaded.Must not be null.
public  StringgetClasspath()
     Returns the classpath this classloader will consult.
public  URLgetResource(String name)
     Finds the resource with the given name.
public  InputStreamgetResourceAsStream(String name)
     Returns a stream to read the requested resource name.
Parameters:
  name - The name of the resource for which a stream is required.Must not be null.
public static  voidinitializeClass(Class theClass)
     Forces initialization of a class in a JDK 1.1 compatible, albeit hacky way.
protected synchronized  ClassloadClass(String classname, boolean resolve)
     Loads a class with this class loader. This class attempts to load the class in an order determined by whether or not the class matches the system/loader package lists, with the loader package list taking priority.
protected  voidlog(String message)
     Logs a message through the project object if one has been provided.
public  voidsetIsolated(boolean isolated)
     Sets whether this classloader should run in isolated mode.


Constructor Detail
ProjectClassLoader
public ProjectClassLoader(Project project)(Code)
Creates a classloader for the given project.
Parameters:
  project - The project to which this classloader is to belong.Must not be null.



ProjectClassLoader
public ProjectClassLoader(ClassLoader parent, Project project, boolean parentFirst)(Code)
Creates a classloader for the given project.
Parameters:
  parent - The parent classloader to which unsatisfied loadingattempts are delegated. May be null,in which case the classloader which loaded thisclass is used as the parent.
Parameters:
  project - The project to which this classloader is to belong.Must not be null.
Parameters:
  parentFirst - If true, indicates that the parentclassloader should be consulted before trying toload the a class through this loader.



ProjectClassLoader
public ProjectClassLoader(Project project, boolean parentFirst)(Code)
Creates a classloader for the given project.
Parameters:
  project - The project to which this classloader is to belong.Must not be null.
Parameters:
  parentFirst - If true, indicates that the parentclassloader should be consulted before trying toload the a class through this loader.



ProjectClassLoader
public ProjectClassLoader(ClassLoader parent, boolean parentFirst)(Code)
Creates an empty class loader. The classloader should be configured with path elements to specify where the loader is to look for classes.
Parameters:
  parent - The parent classloader to which unsatisfied loadingattempts are delegated. May be null,in which case the classloader which loaded thisclass is used as the parent.
Parameters:
  parentFirst - If true, indicates that the parentclassloader should be consulted before trying toload the a class through this loader.




Method Detail
addLoaderPackageRoot
public void addLoaderPackageRoot(String packageRoot)(Code)
Adds a package root to the list of packages which must be loaded using this loader. All subpackages are also included.
Parameters:
  packageRoot - The root of all packages to be included.Should not be null.



addPathElement
public void addPathElement(String pathElement) throws ProjectException(Code)
Adds an element to the classpath to be searched.
Parameters:
  pathElement - The path element to add. Must not benull.
exception:
  ProjectException - if the given path element cannot be resolvedagainst the project.



addSystemPackageRoot
public void addSystemPackageRoot(String packageRoot)(Code)
Adds a package root to the list of packages which must be loaded on the parent loader. All subpackages are also included.
Parameters:
  packageRoot - The root of all packages to be included.Should not be null.



cleanup
public synchronized void cleanup()(Code)
Cleans up any resources held by this classloader. Any open archive files are closed.



findClass
public Class findClass(String name) throws ClassNotFoundException(Code)
Searches for and load a class on the classpath of this class loader.
Parameters:
  name - The name of the class to be loaded. Must not benull. the required Class object
exception:
  ClassNotFoundException - if the requested class does not existon this loader's classpath.



findResources
protected Enumeration findResources(String name) throws IOException(Code)
Returns an enumeration of URLs representing all the resources with the given name by searching the class loader's classpath.
Parameters:
  name - The resource name to search for.Must not be null. an enumeration of URLs for the resources
exception:
  IOException - if I/O errors occurs (can't happen)



forceLoadClass
public Class forceLoadClass(String classname) throws ClassNotFoundException(Code)
Loads a class through this class loader even if that class is available on the parent classpath. This ensures that any classes which are loaded by the returned class will use this classloader.
Parameters:
  classname - The name of the class to be loaded.Must not be null. the required Class object
exception:
  ClassNotFoundException - if the requested class does not existon this loader's classpath.



forceLoadSystemClass
public Class forceLoadSystemClass(String classname) throws ClassNotFoundException(Code)
Loads a class through this class loader but defer to the parent class loader. This ensures that instances of the returned class will be compatible with instances which which have already been loaded on the parent loader.
Parameters:
  classname - The name of the class to be loaded.Must not be null. the required Class object
exception:
  ClassNotFoundException - if the requested class does not existon this loader's classpath.



getClasspath
public String getClasspath()(Code)
Returns the classpath this classloader will consult. the classpath used for this classloader, with elementsseparated by the path separator for the system.



getResource
public URL getResource(String name)(Code)
Finds the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.
Parameters:
  name - The name of the resource for which a stream is required.Must not be null. a URL for reading the resource, or null if theresource could not be found or the caller doesn't haveadequate privileges to get the resource.



getResourceAsStream
public InputStream getResourceAsStream(String name)(Code)
Returns a stream to read the requested resource name.
Parameters:
  name - The name of the resource for which a stream is required.Must not be null. a stream to the required resource or null if theresource cannot be found on the loader's classpath.



initializeClass
public static void initializeClass(Class theClass)(Code)
Forces initialization of a class in a JDK 1.1 compatible, albeit hacky way.
Parameters:
  theClass - The class to initialize.Must not be null.



loadClass
protected synchronized Class loadClass(String classname, boolean resolve) throws ClassNotFoundException(Code)
Loads a class with this class loader. This class attempts to load the class in an order determined by whether or not the class matches the system/loader package lists, with the loader package list taking priority. If the classloader is in isolated mode, failure to load the class in this loader will result in a ClassNotFoundException.
Parameters:
  classname - The name of the class to be loaded.Must not be null.
Parameters:
  resolve - true if all classes upon which this classdepends are to be loaded. the required Class object
exception:
  ClassNotFoundException - if the requested class does not existon the system classpath (when not in isolated mode) or this loader'sclasspath.



log
protected void log(String message)(Code)
Logs a message through the project object if one has been provided.
Parameters:
  message - The message to log.Should not be null.
Parameters:
  priority - The logging priority of the message.



setIsolated
public void setIsolated(boolean isolated)(Code)
Sets whether this classloader should run in isolated mode. In isolated mode, classes not found on the given classpath will not be referred to the parent class loader but will cause a ClassNotFoundException.
Parameters:
  isolated - Whether or not this classloader should run inisolated mode.



Methods inherited from java.lang.ClassLoader
public synchronized void clearAssertionStatus()(Code)(Java Doc)
final protected Class defineClass(byte[] b, int off, int len) throws ClassFormatError(Code)(Java Doc)
final protected Class defineClass(String name, byte[] b, int off, int len) throws ClassFormatError(Code)(Java Doc)
final protected Class defineClass(String name, byte[] b, int off, int len, ProtectionDomain protectionDomain) throws ClassFormatError(Code)(Java Doc)
final protected Class defineClass(String name, java.nio.ByteBuffer b, ProtectionDomain protectionDomain) throws ClassFormatError(Code)(Java Doc)
protected Package definePackage(String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion, String implVendor, URL sealBase) throws IllegalArgumentException(Code)(Java Doc)
protected Class findClass(String name) throws ClassNotFoundException(Code)(Java Doc)
protected String findLibrary(String libname)(Code)(Java Doc)
final protected Class findLoadedClass(String name)(Code)(Java Doc)
protected URL findResource(String name)(Code)(Java Doc)
protected Enumeration<URL> findResources(String name) throws IOException(Code)(Java Doc)
final protected Class findSystemClass(String name) throws ClassNotFoundException(Code)(Java Doc)
protected Package getPackage(String name)(Code)(Java Doc)
protected Package[] getPackages()(Code)(Java Doc)
final public ClassLoader getParent()(Code)(Java Doc)
public URL getResource(String name)(Code)(Java Doc)
public InputStream getResourceAsStream(String name)(Code)(Java Doc)
public Enumeration<URL> getResources(String name) throws IOException(Code)(Java Doc)
public static ClassLoader getSystemClassLoader()(Code)(Java Doc)
public static URL getSystemResource(String name)(Code)(Java Doc)
public static InputStream getSystemResourceAsStream(String name)(Code)(Java Doc)
public static Enumeration<URL> getSystemResources(String name) throws IOException(Code)(Java Doc)
public Class loadClass(String name) throws ClassNotFoundException(Code)(Java Doc)
protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException(Code)(Java Doc)
final protected void resolveClass(Class c)(Code)(Java Doc)
public synchronized void setClassAssertionStatus(String className, boolean enabled)(Code)(Java Doc)
public synchronized void setDefaultAssertionStatus(boolean enabled)(Code)(Java Doc)
public synchronized void setPackageAssertionStatus(String packageName, boolean enabled)(Code)(Java Doc)
final protected void setSigners(Class c, Object[] signers)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.