net.dpml.transit.tools
Class PluginTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by net.dpml.transit.tools.PluginTask
Direct Known Subclasses:
PluginTask

public class PluginTask
extends Task

The plugin task handles the establishment of ant tasks, listeners, and antlibs derived from a classloader established by the transit sub-system.

Version:
1.1.0
Author:
Digital Product Meta Library

Nested Class Summary
static class PluginTask.Antlib
          Nested element with the <plugin> element declaring a packaged resource and urn of an antlib descriptor to be loaded from the classloader established by the transit plugin descriptor.
static class PluginTask.Listener
          Nested element with the <plugin> element declaring the name and class of a project listener to be loaded from the classloader established by the transit plugin descriptor.
static class PluginTask.Task
          Nested element with the <plugin> element declaring the name and class of a task to be loaded from the classloader established by the transit plugin descriptor.
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
PluginTask()
           
 
Method Summary
 PluginTask.Antlib createAntlib()
          Create and associate a new antlib urn entry with the plugin.
 PluginTask.Listener createListener()
          Create and associate a new build listener with the plugin.
 PluginTask.Task createTask()
          Create and associate a new task entry with the plugin.
 void execute()
          Load the plugin and handle registration of listeners, tasks, and antlib declarations based on the nested nested task directives.
 URI getUri()
          Return the artifact uri of the plugin.
static void initialize(Task task)
          Initialize the supplied task.
 void setProject(Project project)
          Set the project.
 void setUri(String uri)
          Set the artifact uri of the plugin from which the task is to be loaded.
 void setUrn(String urn)
          Overload the urn to assign to the plugin.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginTask

public PluginTask()
Method Detail

setProject

public void setProject(Project project)
Set the project.

Parameters:
project - the current project

createAntlib

public PluginTask.Antlib createAntlib()
Create and associate a new antlib urn entry with the plugin.

Returns:
the new antlib entry

createTask

public PluginTask.Task createTask()
Create and associate a new task entry with the plugin.

Returns:
the new task entry

createListener

public PluginTask.Listener createListener()
Create and associate a new build listener with the plugin.

Returns:
the new listener entry

setUri

public void setUri(String uri)
Set the artifact uri of the plugin from which the task is to be loaded.

Parameters:
uri - an artifact plugin uri

setUrn

public void setUrn(String urn)
Overload the urn to assign to the plugin.

Parameters:
urn - the urn to use

getUri

public URI getUri()
Return the artifact uri of the plugin.

Returns:
the plugin uri

execute

public void execute()
             throws BuildException
Load the plugin and handle registration of listeners, tasks, and antlib declarations based on the nested nested task directives.

Overrides:
execute in class Task
Throws:
BuildException - if an error occurs during plugin loading or deployment

initialize

public static void initialize(Task task)
                       throws BuildException
Initialize the supplied task.

Parameters:
task - the task to initialize
Throws:
BuildException - if an initialization error occurs