Top Description Fields Constructors Methods
org.apache.tools.ant.util

public final Class SplitClassLoader

extends AntClassLoader
Class Inheritance
Imports
org.apache.tools.ant.AntClassLoader, .Project, org.apache.tools.ant.types.Path

Specialized classloader for tasks that need finer grained control over which classes are to be loaded via Ant's classloader and which should not even if they are available.

Field Summary

Modifier and TypeField and Description
private final String[]

Constructor Summary

AccessConstructor and Description
public
SplitClassLoader(ClassLoader
ClassLoader
parent
,
Path
Path
path
,
Project
Project
project
,
String[]
classes contained herein will not be loaded via Ant's classloader
splitClasses
)

Method Summary

Modifier and TypeMethod and Description
private boolean
isSplit(String classname)

protected synchronized Class<?>
loadClass(String
The name of the class to be loaded. Must not be null.
classname
,
boolean
true if all classes upon which this class depends are to be loaded.
resolve
)

Overrides org.apache.tools.ant.AntClassLoader.loadClass.

Loads a class with this class loader.
Inherited from org.apache.tools.ant.AntClassLoader:
addJavaLibrariesaddLoaderPackageRootaddPathComponentaddPathElementaddPathFileaddSystemPackageRootbuildFinishedbuildStartedcleanupclosedefineClassFromDatadefinePackagedefinePackagefindClassfindResourcefindResourcesfindResourcesforceLoadClassforceLoadSystemClassgetClasspathgetConfiguredParentgetNamedResourcesgetResourcegetResourceAsStreamgetResourcesgetResourceURLinitializeClassisInPathlogmessageLoggednewAntClassLoaderresetThreadContextLoadersetClassPathsetIsolatedsetParentsetParentFirstsetProjectsetThreadContextLoadersubBuildFinishedsubBuildStartedtargetFinishedtargetStartedtaskFinishedtaskStartedtoString

Field Detail

splitClassesback to summary
private final String[] splitClasses

Constructor Detail

SplitClassLoaderback to summary
public SplitClassLoader(ClassLoader parent, Path path, Project project, String[] splitClasses)
Parameters
parent:ClassLoader

ClassLoader

path:Path

Path

project:Project

Project

splitClasses:String[]

classes contained herein will not be loaded via Ant's classloader

Method Detail

isSplitback to summary
private boolean isSplit(String classname)
loadClassback to summary
protected synchronized Class<?> loadClass(String classname, boolean resolve) throws ClassNotFoundException

Overrides org.apache.tools.ant.AntClassLoader.loadClass.

Doc from org.apache.tools.ant.AntClassLoader.loadClass.

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:String

The name of the class to be loaded. Must not be null.

resolve:boolean

true if all classes upon which this class depends are to be loaded.

Returns:Class<?>

the required Class object

Annotations
@Override
Exceptions
ClassNotFoundException:
if the requested class does not exist on the system classpath (when not in isolated mode) or this loader's classpath.