org.jomc.ant
Class ProjectClassLoader

Package class diagram package ProjectClassLoader
java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.jomc.ant.ProjectClassLoader

public class ProjectClassLoader
extends URLClassLoader

Class loader supporting JOMC resources backed by a project.

Version:
$JOMC: ProjectClassLoader.java 4256 2012-02-13 06:32:10Z schulte2005 $
Author:
Christian Schulte

Constructor Summary
ProjectClassLoader(org.apache.tools.ant.Project project, org.apache.tools.ant.types.Path classpath)
          Creates a new ProjectClassLoader instance taking a project and a class path.
 
Method Summary
 void close()
          Closes the class loader.
protected  void finalize()
          Removes temporary resources.
 URL findResource(String name)
          Finds a resource with a given name.
 Enumeration<URL> findResources(String name)
          Gets all resources matching a given name.
static Set<String> getDefaultModletExcludes()
          Gets a set of modlet names excluded by default.
static Set<String> getDefaultProviderExcludes()
          Gets a set of provider names excluded by default.
static Set<String> getDefaultSchemaExcludes()
          Gets a set of schema public identifiers excluded by default.
static Set<String> getDefaultServiceExcludes()
          Gets a set of service class names excluded by default.
 Modlets getExcludedModlets()
          Gets a set of modlets excluded during resource loading.
 Set<String> getExcludedProviders()
          Gets a set of providers excluded during resource loading.
 Schemas getExcludedSchemas()
          Gets a set of schemas excluded during resource loading.
 Services getExcludedServices()
          Gets a set of services excluded during resource loading.
 Set<String> getModletExcludes()
          Gets a set of modlet names to exclude.
 Set<String> getModletResourceLocations()
          Gets a set of modlet resource locations to filter.
 org.apache.tools.ant.Project getProject()
          Gets the project of the instance.
 Set<String> getProviderExcludes()
          Gets a set of provider names to exclude.
 Set<String> getProviderResourceLocations()
          Gets a set of provider resource locations to filter.
 Set<String> getSchemaExcludes()
          Gets a set of schema public identifiers to exclude.
 Set<String> getServiceExcludes()
          Gets a set of service class names to exclude.
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, 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, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectClassLoader

public ProjectClassLoader(org.apache.tools.ant.Project project,
                          org.apache.tools.ant.types.Path classpath)
                   throws MalformedURLException
Creates a new ProjectClassLoader instance taking a project and a class path.

Parameters:
project - The project to which this class loader is to belong.
classpath - The class path to use for loading.
Throws:
MalformedURLException - if classpath contains unsupported elements.
Method Detail

getProject

public final org.apache.tools.ant.Project getProject()
Gets the project of the instance.

Returns:
The project of the instance.

findResource

public URL findResource(String name)
Finds a resource with a given name.

Overrides:
findResource in class URLClassLoader
Parameters:
name - The name of the resource to search.
Returns:
An URL object for reading the resource or null, if no resource matching name is found.

findResources

public Enumeration<URL> findResources(String name)
                               throws IOException
Gets all resources matching a given name.

Overrides:
findResources in class URLClassLoader
Parameters:
name - The name of the resources to get.
Returns:
An enumeration of URL objects of found resources.
Throws:
IOException - if getting resources fails.

getModletResourceLocations

public final Set<String> getModletResourceLocations()
Gets a set of modlet resource locations to filter.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the modlet resource locations property.

Returns:
A set of modlet resource locations to filter.

getProviderResourceLocations

public final Set<String> getProviderResourceLocations()
Gets a set of provider resource locations to filter.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the provider resource locations property.

Returns:
A set of provider resource locations to filter.

getModletExcludes

public final Set<String> getModletExcludes()
Gets a set of modlet names to exclude.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the modlet excludes property.

Returns:
A set of modlet names to exclude.

getDefaultModletExcludes

public static Set<String> getDefaultModletExcludes()
                                            throws IOException
Gets a set of modlet names excluded by default.

Returns:
An unmodifiable set of modlet names excluded by default.
Throws:
IOException - if reading configuration resources fails.

getExcludedModlets

public final Modlets getExcludedModlets()
Gets a set of modlets excluded during resource loading.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the excluded modlets property.

Returns:
A set of modlets excluded during resource loading.

getProviderExcludes

public final Set<String> getProviderExcludes()
Gets a set of provider names to exclude.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the provider excludes property.

Returns:
A set of providers to exclude.

getDefaultProviderExcludes

public static Set<String> getDefaultProviderExcludes()
                                              throws IOException
Gets a set of provider names excluded by default.

Returns:
An unmodifiable set of provider names excluded by default.
Throws:
IOException - if reading configuration resources fails.

getExcludedProviders

public final Set<String> getExcludedProviders()
Gets a set of providers excluded during resource loading.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the excluded providers property.

Returns:
A set of providers excluded during resource loading.

getServiceExcludes

public final Set<String> getServiceExcludes()
Gets a set of service class names to exclude.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the service excludes property.

Returns:
A set of service class names to exclude.

getDefaultServiceExcludes

public static Set<String> getDefaultServiceExcludes()
                                             throws IOException
Gets a set of service class names excluded by default.

Returns:
An unmodifiable set of service class names excluded by default.
Throws:
IOException - if reading configuration resources fails.

getExcludedServices

public final Services getExcludedServices()
Gets a set of services excluded during resource loading.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the excluded services property.

Returns:
Services excluded during resource loading.

getSchemaExcludes

public final Set<String> getSchemaExcludes()
Gets a set of schema public identifiers to exclude.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the schema excludes property.

Returns:
A set of schema public identifiers to exclude.

getDefaultSchemaExcludes

public static Set<String> getDefaultSchemaExcludes()
                                            throws IOException
Gets a set of schema public identifiers excluded by default.

Returns:
An unmodifiable set of schema public identifiers excluded by default.
Throws:
IOException - if reading configuration resources fails.

getExcludedSchemas

public final Schemas getExcludedSchemas()
Gets a set of schemas excluded during resource loading.

This accessor method returns a reference to the live set, not a snapshot. Therefore any modification you make to the returned set will be present inside the object. This is why there is no set method for the excluded schemas property.

Returns:
Schemas excluded during resource loading.

close

public void close()
           throws IOException
Closes the class loader.

Throws:
IOException - if closing the class loader fails.

finalize

protected void finalize()
                 throws Throwable
Removes temporary resources.

Overrides:
finalize in class Object
Throws:
Throwable - if finalization fails.


Copyright © 2005-2012 The JOMC Project. All Rights Reserved.Get JOMC at SourceForge.net. Fast, secure and Free Open Source software downloads
Please note that this documentation is maintained by non-native english speaking authors. As such, you may encounter phrases or wordings which seem imprecise or may even have a totally different meaning to native english speaking readers than what the individual author was trying to express. If you are a native english speaking reader and find any such phrases or wordings we kindly ask you to send an email to the corresponding author and help us improve this documentation in order to avoid misunderstandings. You will find the authors' email addresses at the top of each class. Please accept our apologies for any inconvenience caused.