Package com.sun.istack.tools
Class ProtectedTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- com.sun.istack.tools.ProtectedTask
-
- All Implemented Interfaces:
Cloneable,org.apache.tools.ant.DynamicAttribute,org.apache.tools.ant.DynamicConfigurator,org.apache.tools.ant.DynamicElement
public abstract class ProtectedTask extends org.apache.tools.ant.Task implements org.apache.tools.ant.DynamicConfiguratorExecutes aTaskin 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.
- Author:
- Kohsuke Kawaguchi, Bhakti Mehta
-
-
Constructor Summary
Constructors Constructor Description ProtectedTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ClassLoadercreateClassLoader()Creates a protective class loader that will host the actual task.ObjectcreateDynamicElement(String name)voidexecute()protected abstract StringgetCoreClassName()Returns the name of the class that extendsTask.voidsetDynamicAttribute(String name, String value)-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
setDynamicAttribute
public void setDynamicAttribute(String name, String value) throws org.apache.tools.ant.BuildException
- Specified by:
setDynamicAttributein interfaceorg.apache.tools.ant.DynamicAttribute- Throws:
org.apache.tools.ant.BuildException
-
createDynamicElement
public Object createDynamicElement(String name) throws org.apache.tools.ant.BuildException
- Specified by:
createDynamicElementin interfaceorg.apache.tools.ant.DynamicElement- Throws:
org.apache.tools.ant.BuildException
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
getCoreClassName
protected abstract String getCoreClassName()
Returns the name of the class that extendsTask. This class will be loaded int the protected classloader.
-
createClassLoader
protected abstract ClassLoader createClassLoader() throws ClassNotFoundException, IOException
Creates a protective class loader that will host the actual task.- Throws:
ClassNotFoundExceptionIOException
-
-