Examples of DefaultExecutor


Examples of com.cedarsoftware.ncube.executor.DefaultExecutor

                            CommandCell cmd = (CommandCell) boundColumn.getValue();
                            Map executionContext = prepareExecutionContext(validCoord, new HashMap());

                            // cmd == null when on default column of a rule axis
                            ruleValue = cmd == null ? isZero(ruleAxisBindCount.get(axisName)) :
                                    new DefaultExecutor().executeCommand(cmd, executionContext);

                            // Wrap rule return value, so that a rule that returns null is not mistaken for a cache miss.
                            ruleExecutionCache.put(boundColumn.id, new Object[]{ruleValue});

                            if (didRuleFire(ruleValue))
View Full Code Here

Examples of org.apache.cocoon.sitemap.impl.DefaultExecutor

        if (this.parent == null) {
            if (this.manager.hasService(SitemapExecutor.ROLE)) {
                this.sitemapExecutor = (SitemapExecutor) this.manager.lookup(SitemapExecutor.ROLE);
                this.releaseSitemapExecutor = true;
            } else {
                this.sitemapExecutor = new DefaultExecutor();
            }
        } else {
            this.sitemapExecutor = this.parent.sitemapExecutor;
        }
    }
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

public class ExecWorkItemHandler implements WorkItemHandler {

  public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
    String command = (String) workItem.getParameter("Command");
    CommandLine commandLine = CommandLine.parse(command);
    DefaultExecutor executor = new DefaultExecutor();
    try {
      executor.execute(commandLine);
      manager.completeWorkItem(workItem.getId(), null);
    } catch (Throwable t) {
      t.printStackTrace();
      manager.abortWorkItem(workItem.getId());
    }
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

                log.info("Process execution complete, exit code=" + result);
            }
        };

        final String vmOptions = config.getProperty(PROP_VM_OPTIONS);
        executor = new DefaultExecutor();
        final CommandLine cl = new CommandLine(jvmFullPath);
        if (vmOptions != null && vmOptions.length() > 0) {
            cl.addArguments(vmOptions);
        }
        cl.addArgument("-jar");
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

      }
    };
   
    streamHandler = new PumpStreamHandler(outStream, errStream);
   
    executor = new DefaultExecutor();
    executor.setStreamHandler(streamHandler);

  }
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

    CommandLine cmd = new CommandLine(cmdlist[0]);
    for (int i = 1; i < cmdlist.length; i++) {
      cmd.addArgument(cmdlist[i]);
    }

    DefaultExecutor exec = new DefaultExecutor();
    exec.execute(cmd);
  }
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

       
        if (clojureArgs != null) {
            cl.addArguments(clojureArgs, false);
        }
       
        Executor exec = new DefaultExecutor();
        Map<String,String> env = new HashMap<String,String>(System.getenv());
        env.put("path", ";");
        env.put("path", System.getProperty("java.home"));
       
        ExecuteStreamHandler handler = new CustomPumpStreamHandler(System.out, System.err, System.in);
        exec.setStreamHandler(handler);
       
        int status;
        try {
            status = exec.execute(cl, env);
        } catch (ExecuteException e) {
            status = e.getExitValue();
        } catch(IOException e) {
            status = 1;
        }
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

            cl.addArguments(clojureArgs, false);
        }

        getLog().debug("Command line: " + cl.toString());

        Executor exec = new DefaultExecutor();
        Map<String, String> env = new HashMap<String, String>(System.getenv());
//        env.put("path", ";");
//        env.put("path", System.getProperty("java.home"));

        ExecuteStreamHandler handler = new PumpStreamHandler(System.out, System.err, System.in);
        exec.setStreamHandler(handler);
        exec.setWorkingDirectory(getWorkingDirectory());

        int status;
        try {
            status = exec.execute(cl, env);
        } catch (ExecuteException e) {
            status = e.getExitValue();
        } catch (IOException e) {
            status = 1;
        }
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

public class ExecWorkItemHandler implements WorkItemHandler {

  public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
    String command = (String) workItem.getParameter("Command");
    CommandLine commandLine = CommandLine.parse(command);
    DefaultExecutor executor = new DefaultExecutor();
    try {
      executor.execute(commandLine);
      manager.completeWorkItem(workItem.getId(), null);
    } catch (Throwable t) {
      t.printStackTrace();
      manager.abortWorkItem(workItem.getId());
    }
View Full Code Here

Examples of org.apache.commons.exec.DefaultExecutor

      // set timeout
      ExecuteWatchdog watchdog = new ExecuteWatchdog(timeout);


      // create executor
      DefaultExecutor executor = new DefaultExecutor();

      executor.setExitValue(this.exitCode);

      this.baos = new ByteArrayOutputStream();

      this.baosErr = new ByteArrayOutputStream();

      if(this.writerStdIn)
      {
        this.bais = new ByteArrayInputStream(in.getText().getBytes());

        executor.setStreamHandler(new PumpStreamHandler(this.baos, this.baosErr, this.bais));
      }
      else
      {
        executor.setStreamHandler(new PumpStreamHandler(this.baos, this.baosErr));
      }

      executor.setWatchdog(watchdog);

      executor.execute(commandLine, new ExecuteResultHandler(){

        public void onProcessComplete(int e)
        {
          out.setText(baos.toString());
        }
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.