org.apache.openjpa.lib.ant
Class AbstractTask

java.lang.Object
  extended by MatchingTask
      extended by org.apache.openjpa.lib.ant.AbstractTask
Direct Known Subclasses:
ApplicationIdToolTask, MappingToolTask, MetaDataToolTask, PCEnhancerTask, ReverseMappingToolTask, SchemaToolTask

public abstract class AbstractTask
extends MatchingTask

Ant tasks all have a nested <config&rt; tag, which uses the configuration as a bean-like task. E.g., you can do: <mytask&rt;
  <config connectionUserName="foo"/&rt;
</mytask&rt;
The default configuration for the system will be used if the <config&rt; subtask is excluded.


Field Summary
protected  Path classpath
           
protected  List fileSets
           
protected  boolean haltOnError
           
protected  boolean isolate
           
protected  boolean useParent
           
 
Constructor Summary
AbstractTask()
           
 
Method Summary
 void addFileset(FileSet set)
           
protected  void assertFiles(String[] files)
          Helper method to throw a standard exception if the task is not given any files to execute on.
 Path createClasspath()
           
 Object createConfig()
           
 void execute()
           
protected abstract  void executeOn(String[] files)
          Perform the task action on the given files.
protected  ClassLoader getClassLoader()
          Return the classloader to use.
 Configuration getConfiguration()
          The task configuration.
protected abstract  ConfigurationImpl newConfiguration()
          Implement this method to return a configuration object for the product in use.
 void setClasspath(Path classPath)
           
 void setHaltOnError(boolean haltOnError)
          Set whether we want the task to ignore all errors.
 void setIsolate(boolean isolate)
          Whether we want the ClassLoader to be isolated from all other ClassLoaders
 void setUseParentClassloader(boolean useParent)
          Whether we want to delegate to the parent ClassLoader for resolveing classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileSets

protected final List fileSets

haltOnError

protected boolean haltOnError

classpath

protected Path classpath

useParent

protected boolean useParent

isolate

protected boolean isolate
Constructor Detail

AbstractTask

public AbstractTask()
Method Detail

setHaltOnError

public void setHaltOnError(boolean haltOnError)
Set whether we want the task to ignore all errors.


setIsolate

public void setIsolate(boolean isolate)
Whether we want the ClassLoader to be isolated from all other ClassLoaders


setUseParentClassloader

public void setUseParentClassloader(boolean useParent)
Whether we want to delegate to the parent ClassLoader for resolveing classes. This may "taint" classes.


getConfiguration

public Configuration getConfiguration()
The task configuration.


newConfiguration

protected abstract ConfigurationImpl newConfiguration()
Implement this method to return a configuration object for the product in use.


executeOn

protected abstract void executeOn(String[] files)
                           throws Exception
Perform the task action on the given files.

Throws:
Exception

getClassLoader

protected ClassLoader getClassLoader()
Return the classloader to use.


assertFiles

protected void assertFiles(String[] files)
Helper method to throw a standard exception if the task is not given any files to execute on. Implementations might call this method as the first step in executeOn(java.lang.String[]) to validate that they are given files to work on.


setClasspath

public void setClasspath(Path classPath)

createClasspath

public Path createClasspath()

createConfig

public Object createConfig()

addFileset

public void addFileset(FileSet set)

execute

public void execute()
             throws BuildException
Throws:
BuildException


Copyright © 2006 Apache Software Foundation. All Rights Reserved.