Class ScriptBundleExecutorImpl

java.lang.Object
org.alfresco.repo.domain.schema.script.ScriptBundleExecutorImpl
All Implemented Interfaces:
ScriptBundleExecutor

public class ScriptBundleExecutorImpl extends Object implements ScriptBundleExecutor
ScriptBundleExecutor implementation. Uses the supplied ScriptExecutor to invoke multiple SQL scripts in a particular directory.
Author:
Matt Ward, Derek Hulley
  • Field Details

    • log

      protected org.apache.commons.logging.Log log
  • Constructor Details

    • ScriptBundleExecutorImpl

      public ScriptBundleExecutorImpl(ScriptExecutor scriptExecutor)
  • Method Details

    • exec

      public void exec(boolean logOnly, String dir, String... scripts)
      Description copied from interface: ScriptBundleExecutor
      Runs a bundle of scripts. If any script within the bundle fails, then the rest of the files are not run.
      Specified by:
      exec in interface ScriptBundleExecutor
      Parameters:
      logOnly - true to catch and log any exceptions or false to rethrow
      dir - Directory where the script bundle may be found.
      scripts - Names of the SQL scripts to run, relative to the specified directory.
    • exec

      public void exec(String dir, String... scripts)
      Description copied from interface: ScriptBundleExecutor
      Runs a bundle of scripts. If any script within the bundle fails, then the rest of the files are not run.
      Specified by:
      exec in interface ScriptBundleExecutor
      Parameters:
      dir - Directory where the script bundle may be found.
      scripts - Names of the SQL scripts to run, relative to the specified directory.
    • execWithPostScript

      public void execWithPostScript(String dir, String postScript, String... scripts)
      Description copied from interface: ScriptBundleExecutor
      Runs a bundle of scripts. If any script within the bundle fails, then the rest of the files are not run, with the exception of postScript - which is always run (a clean-up script for example).
      Specified by:
      execWithPostScript in interface ScriptBundleExecutor
      Parameters:
      dir - Directory where the script bundle may be found.
      postScript - A script that is always run after the other scripts.
      scripts - Names of the SQL scripts to run, relative to the specified directory.