org.schmant
Class ScriptExecutorFactory

java.lang.Object
  extended by org.schmant.ScriptExecutorFactory
Direct Known Subclasses:
GroovyExecutorFactory, JRubyExecutorFactory, JsScriptExecutorFactory, JythonExecutorFactory

public abstract class ScriptExecutorFactory
extends Object

This interface is implemented by service providers that provide support for different build script implementation languages, such as Groovy or JavaScript. Launcher uses the JAR file lookup mechanism to discover all available script executor factory implementations, It then uses the script executor factory that handles the file name extension for the build script to create a ScriptExecutor that it uses to run the build script.

Implementation of this class must have a constructor without arguments.

Since:
1.1
Author:
Karl Gustafsson
See Also:
ScriptExecutor, Launcher

Constructor Summary
ScriptExecutorFactory()
           
 
Method Summary
abstract  boolean canHandleScriptFileNameExtension(String extension)
          Does this script executor factory create a ScriptExecutor that can handle build scripts with the supplied file name extension?
abstract  ScriptExecutor create(LauncherSettings ls, Report r)
          Create a ScriptExecutor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptExecutorFactory

public ScriptExecutorFactory()
Method Detail

canHandleScriptFileNameExtension

public abstract boolean canHandleScriptFileNameExtension(String extension)
Does this script executor factory create a ScriptExecutor that can handle build scripts with the supplied file name extension?

Parameters:
extension - The file name extension in lower case, without the leading dot.
Returns:
true if this script executor factory can handle the script file.

create

public abstract ScriptExecutor create(LauncherSettings ls,
                                      Report r)
Create a ScriptExecutor.

Parameters:
ls - Command line arguments.
r - A report for logging output to.
Returns:
A script executor.