Examples of DefaultExecutor


Examples of org.apache.commons.exec.DefaultExecutor

        String line = getPlay2().getAbsolutePath();

        CommandLine cmdLine = CommandLine.parse(line);
        cmdLine.addArgument("clean");
        DefaultExecutor executor = new DefaultExecutor();

        if (timeout > 0) {
            ExecuteWatchdog watchdog = new ExecuteWatchdog(timeout);
            executor.setWatchdog(watchdog);
        }

        executor.setWorkingDirectory(project.getBasedir());
        executor.setExitValue(0);
        try {
            executor.execute(cmdLine, getEnvironment());
        } catch (IOException e) {
            throw new MojoExecutionException("Error during cleanup", e);
        }
       
        // Also delete the dist directory
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

                }
            }

            CommandLine commandLine = getExecutablePath( enviro, workingDirectory );

            Executor exec = new DefaultExecutor();

            String[] args = new String[commandArguments.size()];
            for ( int i = 0; i < commandArguments.size(); i++ )
            {
                args[i] = (String) commandArguments.get( i );
            }

            commandLine.addArguments( args, false );

            exec.setWorkingDirectory( workingDirectory );

            fillSuccessCodes(exec);
           
            // this code ensures the output gets logged vai maven logging, but at the same time prevents
            // partial line output, like input prompts.
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

            throws MuleControllerException
    {
        CommandLine commandLine = new CommandLine(muleBin);
        commandLine.addArgument(command);
        commandLine.addArguments(args);
        DefaultExecutor executor = new DefaultExecutor();
        ExecuteWatchdog watchdog = new ExecuteWatchdog(timeout);
        executor.setWatchdog(watchdog);
        executor.setStreamHandler(new PumpStreamHandler());
        return doExecution(executor, commandLine, newEnv);
    }
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

    @Override
    public int getProcessId()
    {
        Map<Object, Object> newEnv = this.copyEnvironmentVariables();
        DefaultExecutor executor = new DefaultExecutor();
        ExecuteWatchdog watchdog = new ExecuteWatchdog(timeout);
        executor.setWatchdog(watchdog);
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
        executor.setStreamHandler(streamHandler);
        if (this.doExecution(executor, new CommandLine(this.muleBin).addArgument("status"), newEnv) == 0)
        {
            Matcher matcher = STATUS_PATTERN.matcher(outputStream.toString());
            if (matcher.find())
            {
View Full Code Here

Examples of org.soybeanMilk.core.DefaultExecutor

  public void setUp()
  {
    try
    {
      Configuration cfg=new ConfigurationParser().parse("org/soybeanMilk/test/unit/core/TestDefaultExecutor.cfg.xml");
      executor=new DefaultExecutor(cfg);
    }
    catch(Exception e)
    {
      log.error("",e);
    }
View Full Code Here

Examples of org.soybeanMilk.core.DefaultExecutor

  public static void main(String[] args) throws Exception
  {
    Configuration cfg=new ConfigurationParser().parse(
        "example/"+Constants.DEFAULT_CONFIG_FILE);
   
    Executor executor=new DefaultExecutor(cfg);
   
    ConvertableObjectSource os = new HashMapObjectSource();
   
    os.set("helloTo", "mars");
    os.set("helloRepeat", 3);
   
    printDiv();
    executor.execute("helloActionXml", os);
   
    printDiv();
    executor.execute("helloActionStatement", os);
   
    printDiv();
    executor.execute("testJavaSyntax", os);
   
    printDiv();
    executor.execute("testAfterBefore", os);
   
    printDiv();
    executor.execute("testException", os);
   
    printDiv();
    executor.execute("", os);
   
    printDiv();
    executor.execute("testRefToEmptyNameAction", os);
  }
View Full Code Here

Examples of org.soybeanMilk.core.DefaultExecutor

  public static void main(String[] args) throws Exception
  {
    Configuration cfg=new ConfigurationParser().parse(
        "example/"+Constants.DEFAULT_CONFIG_FILE);
   
    Executor executor=new DefaultExecutor(cfg);
   
    ConvertableObjectSource os = new HashMapObjectSource();
   
    os.set("helloTo", "friend");
    os.set("helloRepeat", 3);
   
    os.set("genericStringInput", "11");
    os.set("genericStringArrayInput", new String[]{"11", "22", "33"});
   
    printDiv();
    executor.execute("helloXml", os);
   
    printDiv();
    executor.execute("helloStatement", os);
   
    printDiv();
    executor.execute("javaSyntax", os);

    printDiv();
    executor.execute("reference", os);
   
    printDiv();
    executor.execute("interceptorBeforeAfter", os);
   
    printDiv();
    executor.execute("interceptorException", os);
   
    printDiv();
    executor.execute("genericSimple", os);
   
    printDiv();
    executor.execute("genericList", os);
   
    printDiv();
    executor.execute("genericSet", os);
   
    printDiv();
    executor.execute("genericArray", os);
   
    System.in.read();
  }
View Full Code Here

Examples of org.soybeanMilk.core.DefaultExecutor

        "org/soybeanMilk/example/"+Constants.DEFAULT_CONFIG_FILE);
   
    DefaultResolverObjectFactory drof=(DefaultResolverObjectFactory)cfg.getResolverObjectFactory();
    drof.setExternalResolverObjectFactory(new SpringBeanFactory());
   
    Executor executor=new DefaultExecutor(cfg);
   
    ObjectSource os = new HashMapObjectSource();
   
    os.set("helloTo", "friend");
    os.set("helloRepeat", 3);
   
    os.set("genericStringInput", "11");
    os.set("genericStringArrayInput", new String[]{"11", "22", "33"});
   
    printDiv();
    executor.execute("helloXml", os);
   
    printDiv();
    executor.execute("helloStatement", os);
   
    printDiv();
    executor.execute("literals", os);
   
    printDiv();
    os.set("dynamicResolver", new DynamicResolver());
    executor.execute("dynamicResolver", os);
   
    printDiv();
    executor.execute("reference", os);
   
    printDiv();
    executor.execute("externalIocResolver", os);
   
    printDiv();
    executor.execute("interceptorBeforeAfter", os);
   
    printDiv();
    executor.execute("interceptorException", os);
   
    printDiv();
    executor.execute("genericSimple", os);
   
    printDiv();
    executor.execute("genericList", os);
   
    printDiv();
    executor.execute("genericSet", os);
   
    printDiv();
    executor.execute("genericArray", os);
   
    System.in.read();
  }
View Full Code Here

Examples of org.soybeanMilk.core.DefaultExecutor

    }
   
    cfg.addExecutable(action);
   
    //创建执行器
    Executor executor=new DefaultExecutor(cfg);
   
    ConvertableObjectSource os = new HashMapObjectSource(new DefaultGenericConverter());
   
    //设置参数
    os.set(argKey_hello_to, "mars");
    os.set(argKey_hello_repeat, 3);
   
    //执行
    executor.execute(actionName, os);
  }
View Full Code Here

Examples of org.soybeanMilk.core.DefaultExecutor

  public void setUp() throws Exception
  {
    try
    {
      Configuration cfg=new ConfigurationParser().parse("org/soybeanMilk/test/unit/core/TestInvoke.cfg.xml");
      executor=new DefaultExecutor(cfg);
    }
    catch(Exception e)
    {
      log.error("",e);
    }
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.