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
- Direct Known Subclasses:
WrapperTask,XJCTask
public abstract class ProtectedTask
extends org.apache.tools.ant.Task
implements org.apache.tools.ant.DynamicConfigurator
Executes a
Task in a special class loader that allows us to control
where to load particular APIs.- Author:
- Kohsuke Kawaguchi, Bhakti Mehta
-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ClassLoaderCreates a protective class loader that will host the actual task.createDynamicElement(String name) voidexecute()protected abstract StringReturns the name of the class that extendsTask.This class will be loaded int the protected classloader.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, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
ProtectedTask
public ProtectedTask()
-
-
Method Details
-
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
- 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
Returns the name of the class that extendsTask.This class will be loaded int the protected classloader.- Returns:
- Task class name
-
createClassLoader
Creates a protective class loader that will host the actual task.- Returns:
- ClassLoader use d for task execution
- Throws:
ClassNotFoundException- if required APIs are not foundIOException- if error happens
-