public abstract class ProtectedTask
extends Task
Task in a special class loader that allows
us to control where to load 2.1 APIs, even if we run in Java 6.
No JDK 1.5 code here, please. This allows us to detect "require JDK5" bug nicely.
| Constructor and Description |
|---|
ProtectedTask() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract ClassLoader |
createClassLoader()
Creates a protective class loader that will host the actual task.
|
Object |
createDynamicElement(String name) |
void |
execute() |
protected abstract String |
getCoreClassName()
Returns the name of the class that extends
Task. |
void |
setDynamicAttribute(String name,
String value) |
public void setDynamicAttribute(String name, String value) throws BuildException
BuildExceptionpublic Object createDynamicElement(String name) throws BuildException
BuildExceptionpublic void execute()
throws BuildException
BuildExceptionprotected abstract String getCoreClassName()
Task.
This class will be loaded int the protected classloader.protected abstract ClassLoader createClassLoader() throws ClassNotFoundException, IOException
ClassNotFoundExceptionIOExceptionCopyright © 2015 Oracle Corporation. All Rights Reserved.