Examples of ScriptRunner


Examples of io.apigee.trireme.core.internal.ScriptRunner

    @Override
    public Scriptable registerExports(Context cx, Scriptable scope, NodeRuntime runner)
        throws InvocationTargetException, IllegalAccessException, InstantiationException
    {
        ScriptRunner internalRunner = (ScriptRunner)runner;
        internalRunner.require("stream", cx);

        ScriptableObject.defineClass(scope, ProcessImpl.class, false, true);
        ScriptableObject.defineClass(scope, ProcessModuleImpl.class);

        ProcessModuleImpl exports = (ProcessModuleImpl)cx.newObject(scope, ProcessModuleImpl.CLASS_NAME);
View Full Code Here

Examples of modbuspal.script.ScriptRunner

        for(int i=0; i<nodes.getLength(); i++ )
        {
            Node scriptNode = nodes.item(i);
            if( scriptNode.getNodeName().compareTo("script")==0 )
            {
                ScriptRunner runner = ScriptRunner.create(scriptNode, this, projectFile, true, assumedType);
                if( runner!=null )
                {
                    addScript(runner);
                }
            }
View Full Code Here

Examples of modbuspal.script.ScriptRunner

     * Adds the specified script file into the project.
     * @param scriptFile the script file to add
     */
    public void addScript(File scriptFile)
    {
        ScriptRunner runner = ScriptRunner.create(this, scriptFile, ScriptRunner.SCRIPT_TYPE_ON_DEMAND);
        addScript(runner);
    }
View Full Code Here

Examples of net.sf.sahi.rhino.ScriptRunner


public class TestReporter {
    public void logTestResult(final HttpRequest request) {
        Session session = request.session();
        ScriptRunner scriptRunner = session.getScriptRunner();
        if (scriptRunner == null) return;
    Report report = scriptRunner.getReport();
        if (report != null) {
            report.addResult(SahiScript.stripSahiFromFunctionNames(request.getParameter("msg")), request.getParameter("type"), request.getParameter("debugInfo"), request.getParameter("failureMsg"));
        }
    }
View Full Code Here

Examples of org.apache.ambari.server.orm.helpers.ScriptRunner

  /**
   * Execute script with autocommit and error tolerance, like psql and sqlplus do by default
   */
  public void executeScript(String filePath) throws SQLException, IOException {
    BufferedReader br = new BufferedReader(new FileReader(filePath));
    ScriptRunner scriptRunner = new ScriptRunner(getConnection(), false, false);
    scriptRunner.runScript(br);
  }
View Full Code Here

Examples of org.apache.ambari.server.orm.helpers.ScriptRunner

  /**
   * Execute script with autocommit and error tolerance, like psql and sqlplus do by default
   */
  public void executeScript(String filePath) throws SQLException, IOException {
    BufferedReader br = new BufferedReader(new FileReader(filePath));
    ScriptRunner scriptRunner = new ScriptRunner(getConnection(), false, false);
    scriptRunner.runScript(br);
  }
View Full Code Here

Examples of org.apache.ibatis.jdbc.ScriptRunner

        out.println("For your safety, the bootstrap SQL script will only run before migrations are applied (i.e. before the changelog exists).  If you're certain, you can run it using the --force option.");
      } else {
        File bootstrap = scriptFile("bootstrap.sql");
        if (bootstrap.exists()) {
          out.println(horizontalLine("Applying: bootstrap.sql", 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(bootstrap), false, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          out.println();
        } else {
          out.println("Error, could not run bootstrap.sql.  The file does not exist.");
        }
View Full Code Here

Examples of org.apache.ibatis.jdbc.ScriptRunner

      Collections.reverse(migrations);
      int steps = 0;
      for (Change change : migrations) {
        if (change.getId().equals(lastChange.getId())) {
          printStream.println(horizontalLine("Undoing: " + change.getFilename(), 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), true, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          if (changelogExists()) {
            deleteChange(change);
          } else {
            printStream.println("Changelog doesn't exist. No further migrations will be undone (normal for the last migration).");
View Full Code Here

Examples of org.apache.ibatis.jdbc.ScriptRunner

      String password = props.getProperty("password");
      String charSetName = props.getProperty("script_char_set");
      PrintWriter outWriter = new PrintWriter(printStream);
      UnpooledDataSource dataSource = new UnpooledDataSource(driverClassLoader, driver, url, username, password);
      dataSource.setAutoCommit(false);
      ScriptRunner scriptRunner = new ScriptRunner(dataSource.getConnection());
      scriptRunner.setCharacterSetName(charSetName);
      scriptRunner.setStopOnError(!force);
      scriptRunner.setLogWriter(outWriter);
      scriptRunner.setErrorLogWriter(outWriter);
      setPropertiesFromFile(scriptRunner, props);
      return scriptRunner;
    } catch (Exception e) {
      throw new MigrationException("Error creating ScriptRunner.  Cause: " + e, e);
    }
View Full Code Here

Examples of org.apache.ibatis.jdbc.ScriptRunner

      }
      List<Change> migrations = getMigrations();
      for (Change change : migrations) {
        if (lastChange == null || change.getId().compareTo(lastChange.getId()) > 0) {
          out.println(horizontalLine("Applying: " + change.getFilename(), 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), false, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          insertChangelog(change);
          out.println();
          if (runOneStepOnly) {
            break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.