Package org.codehaus.groovy.tools.shell

Examples of org.codehaus.groovy.tools.shell.Groovysh.run()


            out = new PrintStream(socket.getOutputStream());
            binding.setVariable("out", out);

            final IO io = new IO(in, out, out);
            final Groovysh gsh = new Groovysh(binding, io);
            gsh.run();
        } catch (Exception e) {
            log.error("Error running the Groovy shell.", e);
        } finally {
            try { if (out != null) out.close(); } catch (Exception e) {}
            try { if (in != null) in.close(); } catch (Exception e) {}
View Full Code Here


        // this being remote means no jline capability is available
        System.setProperty("jline.terminal", UnsupportedTerminal.class.getName());
        Terminal.resetTerminal();

        Groovysh shell = createShell(stdin, stdout, stderr);
        return shell.run(args.toArray(new String[args.size()]));
    }

    @SuppressWarnings({"unchecked","rawtypes"})
    protected Groovysh createShell(InputStream stdin, PrintStream stdout,
        PrintStream stderr) {
View Full Code Here

      printlnResource(Constants.RES_SQOOP_SHELL_BANNER);
      println();

      // Switch to interactive mode
      setInteractive(true);
      shell.run(args);

    } else {
      // Batch mode (with a script file):
      File script = new File(args[0]);
      if (!script.isAbsolute()) {
View Full Code Here

      // Interactive mode:
      shell.getIo().setVerbosity(Verbosity.QUIET);
      shell.getIo().out.println(clientResource.getString(Constants
          .RES_SQOOP_SHELL_BANNER));
      shell.getIo().out.println();
      shell.run(args);

    } else {
      // Batch mode (with a script file):
      File script = new File(args[0]);
      if (!script.isAbsolute()) {
View Full Code Here

      setup.println( "import java.util.concurrent.TimeUnit;" );
      //setup.println( "set verbosity QUIET;" );
      //setup.println( "set show-last-result false;" );
      Groovysh shell = new Groovysh();
      shell.execute( buffer.toString() );
      shell.run();
    }
  }

}
View Full Code Here

    wrapper = new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          SshTerminal.registerEnvironment(env);
          shell.run();
          callback.onExit(0);
        } catch (RuntimeException e) {
          callback.onExit(-1, e.getMessage());
        } catch (Error e) {
          callback.onExit(-1, e.getMessage());
View Full Code Here

      setup.println( "import java.util.concurrent.TimeUnit;" );
      //setup.println( "set verbosity QUIET;" );
      //setup.println( "set show-last-result false;" );
      Groovysh shell = new Groovysh();
      shell.execute( buffer.toString() );
      shell.run();
    }
  }

}
View Full Code Here

              final GroovyShell shell = new GroovyShell(binding, conf);
              shell.run(scriptFile, args);
          }
          else {
              final Groovysh shell = new Groovysh(binding, new IO());
              shell.run();
          }
        }
        finally {
          if (applicationContext instanceof DisposableBean) {
            ((DisposableBean) applicationContext).destroy();
View Full Code Here

      printlnResource(Constants.RES_SQOOP_SHELL_BANNER);
      println();

      // Switch to interactive mode
      setInteractive(true);
      shell.run(args);

    } else {
      // Batch mode (with a script file):
      File script = new File(args[0]);
      if (!script.isAbsolute()) {
View Full Code Here

        // this being remote means no jline capability is available
        System.setProperty("jline.terminal", UnsupportedTerminal.class.getName());
        Terminal.resetTerminal();

        Groovysh shell = createShell(stdin, stdout, stderr);
        return shell.run(args.toArray(new String[args.size()]));
    }

    protected Groovysh createShell(InputStream stdin, PrintStream stdout,
        PrintStream stderr) {
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.