net.sourceforge.addam.ddlrun.runners
Class ScriptGroupRunner

java.lang.Object
  extended by net.sourceforge.addam.ddlrun.runners.ScriptGroupRunner
All Implemented Interfaces:
Runner

public class ScriptGroupRunner
extends Object
implements Runner

Used to run a group (folder) of scripts.

Since:
Mar 5, 2005
Author:
TIM3

Field Summary
private static String MASTER_DRIVER
           
private  ResourceReaderFactory readerFactory
           
private  ArrayList runLoggers
           
private  Filter scriptFilter
           
private  Map scriptRunnerMap
           
private static String SEPARATOR_CHAR
           
 
Constructor Summary
ScriptGroupRunner(ResourceReaderFactory readerFactory, Filter scriptFilter, Map scriptRunnerMap)
          Constructs a ScriptGroupRunner
 
Method Summary
 void addRunLogger(RunLogger logger)
           
(package private) static String getExtension(String resource)
           
private  void logRunComplete(String group, long time)
           
private  void logRunFailure(String group, String script, Exception e)
           
private  void logRunScript(String script, long time)
           
 void run(String group)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MASTER_DRIVER

private static final String MASTER_DRIVER
See Also:
Constant Field Values

SEPARATOR_CHAR

private static final String SEPARATOR_CHAR
See Also:
Constant Field Values

readerFactory

private final ResourceReaderFactory readerFactory

scriptFilter

private final Filter scriptFilter

scriptRunnerMap

private final Map scriptRunnerMap

runLoggers

private final ArrayList runLoggers
Constructor Detail

ScriptGroupRunner

public ScriptGroupRunner(ResourceReaderFactory readerFactory,
                         Filter scriptFilter,
                         Map scriptRunnerMap)
Constructs a ScriptGroupRunner

Parameters:
readerFactory - used to read the resources
scriptFilter - used to determine which scripts need to run
scriptRunnerMap - registry of runners by type
Method Detail

addRunLogger

public void addRunLogger(RunLogger logger)

logRunComplete

private void logRunComplete(String group,
                            long time)
                     throws Exception
Throws:
Exception

logRunScript

private void logRunScript(String script,
                          long time)
                   throws Exception
Throws:
Exception

logRunFailure

private void logRunFailure(String group,
                           String script,
                           Exception e)
                    throws Exception
Throws:
Exception

run

public void run(String group)
         throws Exception
Specified by:
run in interface Runner
Parameters:
group - the group that contains the list of scripts to run
Throws:
IOException
Exception

getExtension

static String getExtension(String resource)


Copyright © 2005-2006 ADDAM Project Team. All Rights Reserved.