Examples of CommandExecutor


Examples of at.tuwien.minimee.util.CommandExecutor

    public RunInfo run()  {
        RunInfo r = new RunInfo();
   
        log.debug("running tool: "+command);
        CommandExecutor cmdExecutor = new CommandExecutor();    
        if (workingDir != null) {
            cmdExecutor.setWorkingDirectory(workingDir);
        }
        long startTime = System.nanoTime();
        try {
            int exitStatus = cmdExecutor.runCommand(command);
            r.setSuccess(exitStatus == 0);
            r.setReport(cmdExecutor.getCommandError());
           
            if (r.isSuccess() && "".equals(r.getReport())) {
                String report = cmdExecutor.getCommandOutput();
                if ("".equals(report)) {
                    r.setReport("Successfully executed command.");
                } else {
                    r.setReport(report);
                }
View Full Code Here

Examples of ch.mtSystems.gcjStubber.model.CommandExecutor

      cmd.add("-w");
      cmd.add("-O2");
      cmd.add("-C");
      for(File f : listFiles(tmpDir)) cmd.add(f.toString());
 
      CommandExecutor commandExecutor = new CommandExecutor(cmd.toArray(new String[0]), tmpDir);
      commandExecutor.execute();
      if(commandExecutor.getOutput().length > 0 || commandExecutor.getError().length > 0)
      {
        StringBuffer sb = new StringBuffer("Compiling java source files failed:\n");
        for(String s : commandExecutor.getOutput()) { sb.append("   [stdout] "); sb.append(s); sb.append("\n"); }
        for(String s : commandExecutor.getError()) { sb.append("   [stderr] "); sb.append(s); sb.append("\n"); }
        throw new Exception(sb.toString());
      }
 
      // create a jar from the .class files
      ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream(jar));
      byte[] buffer = new byte[2048];
 
      for(File f : listFiles(tmpDir))
      {
        if(!f.getName().endsWith(".class")) continue;
 
        String entryName = f.toString().substring(tmpDir.toString().length()+1).replaceAll("\\\\", "/");
        ZipEntry zipEntry = new ZipEntry(entryName);
        outputStream.putNextEntry(zipEntry);
 
        InputStream inputStream = new FileInputStream(f);
        while(true)
        {
          int len = inputStream.read(buffer);
          if(len < 0) break;
          outputStream.write(buffer, 0, len);
        }
        inputStream.close();
 
        outputStream.closeEntry();
      }
      outputStream.flush();
      outputStream.close();
     
      // compile the jar to an object
      cmd.clear();
      cmd.add(cmdGcj.toString());
      cmd.add("-s");
      cmd.add("-O2");
      cmd.add("-c");
      cmd.add(jar.toString());
      cmd.add("-o");
      cmd.add(object.toString());
 
      commandExecutor = new CommandExecutor(cmd.toArray(new String[0]), tmpDir);
      commandExecutor.execute();
      if(commandExecutor.getOutput().length > 0 || commandExecutor.getError().length > 0)
      {
        StringBuffer sb = new StringBuffer("Compiling the jar failed:\n");
        for(String s : commandExecutor.getOutput()) { sb.append("   [stdout] "); sb.append(s); sb.append("\n"); }
        for(String s : commandExecutor.getError()) { sb.append("   [stderr] "); sb.append(s); sb.append("\n"); }
        throw new Exception(sb.toString());
      }
    } finally
    {
      // clean up tmp dir
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.interceptor.CommandExecutor

    CacheHandler cacheHandler=Context.getProcessEngineConfiguration().getCacheHandler();
   
    Object cacheData = cacheHandler.getCacheData("GetStartProcessByUserId_" + this.userId);
   
    if(cacheData==null){
      CommandExecutor commandExecutor=Context.getProcessEngineConfiguration().getCommandExecutor();
     
      List<Map<String, Object>> processDefData=commandExecutor.execute(new GetProcessDefinitionGroupKeyCmd());
     
      List<Map<String,String>> processData=new ArrayList<Map<String,String>>();
     
      for (Map<String, Object> map : processDefData) {
        String processKey=StringUtil.getString(map.get("PROCESS_KEY"));
        boolean state=commandExecutor.execute(new VerificationStartUserCmd(this.userId,processKey,null));
        if(state){
          Map<String, String> dataMap=new HashMap<String, String>();
         
         
View Full Code Here

Examples of com.mangofactory.swagger.core.CommandExecutor

        parameterContext.put("methodParameter", methodParameter.getMethodParameter());
        parameterContext.put("resolvedMethodParameter", methodParameter);
        parameterContext.put("swaggerGlobalSettings", swaggerGlobalSettings);

        CommandExecutor<Map<String, Object>, RequestMappingContext> commandExecutor = new CommandExecutor();

        commandExecutor.execute(commandList, parameterContext);

        Map<String, Object> result = parameterContext.getResult();

        if (!shouldExpand(methodParameter)) {
          Parameter parameter = new Parameter(
View Full Code Here

Examples of eu.planets_project.pp.plato.util.CommandExecutor

    public RunInfo run()  {
        RunInfo r = new RunInfo();
   
        log.debug("running tool: "+command);
        CommandExecutor cmdExecutor = new CommandExecutor();    
        if (workingDir != null) {
            cmdExecutor.setWorkingDirectory(workingDir);
        }
        long startTime = System.nanoTime();
        try {
            int exitStatus = cmdExecutor.runCommand(command);
            r.setSuccess(exitStatus == 0);
            r.setReport(cmdExecutor.getCommandError());
           
            if (r.isSuccess() && "".equals(r.getReport())) {
                String report = cmdExecutor.getCommandOutput();
                if ("".equals(report)) {
                    r.setReport("Successfully executed command.");
                } else {
                    r.setReport(report);
                }
View Full Code Here

Examples of eu.scape_project.planning.utils.CommandExecutor

   
    public String characterise(File input) throws PlanningException{
        if (FITS_HOME == null) {
            throw new PlanningException("FITS is not properly configured (FITS_HOME is not defined).");
        }
        CommandExecutor cmdExecutor = new CommandExecutor();
        cmdExecutor.setWorkingDirectory(FITS_HOME);
        String scriptExt;
        if ("Linux".equalsIgnoreCase(System.getProperty("os.name"))){
            scriptExt = "./fits.sh";
        } else {
            scriptExt = "cmd /c %FITS_HOME%/fits";
        }
        File output = new File(OS.getTmpPath() + "fits"+System.nanoTime()+".out");
        try {
            String commandLine = FITS_COMMAND.replace("%FITS_EXEC%", scriptExt)
                .replace("%INPUT%", input.getAbsolutePath())
                .replace("%OUTPUT%", output.getAbsolutePath());
           
            try {
                int exitcode = cmdExecutor.runCommand(commandLine);
                if (exitcode != 0) {
                    String cmdError = cmdExecutor.getCommandError();
                    throw new PlanningException("FITS characterisation for file: " + input + " failed: " + cmdError);
                }
                if (!output.exists()) {
                    throw new PlanningException("FITS characterisation for file: " + input + " failed: no output was written.");
                }
View Full Code Here

Examples of npanday.executable.CommandExecutor

        logger.info( "NPANDAY-068-003: Compiling Artifact: Vendor = "
            + compilerContext.getCompilerRequirement().getVendor() + ", Language = "
            + compilerContext.getCompilerRequirement().getLanguage() + ", Assembly Name = "
            + compilerContext.getArtifact().getAbsolutePath() );

        CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor();
        commandExecutor.setLogger( logger );
        commandExecutor.executeCommand( getExecutable(), getCommands(), getExecutionPath(), failOnErrorOutput() );
    }
View Full Code Here

Examples of org.activiti.engine.impl.interceptor.CommandExecutor

    LogUtil.readJavaUtilLoggingConfigFromClasspath();
  }

  public static void main(String[] args) {
    ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
    CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
    commandExecutor.execute(new Command<Object> (){
      public Object execute(CommandContext commandContext) {
        commandContext
          .getSession(DbSqlSession.class)
          .dbSchemaUpdate();
        return null;
View Full Code Here

Examples of org.apache.geronimo.gshell.command.CommandExecutor

      ShellContext.set(oldContext);
    }
  }

  private InteractiveShell createInteractiveShell(ShellContext ctx) throws InitializationException {
    CommandExecutor executor = createCommandExecutor(ctx);
    ctx.setCommandExecutor(executor);
    ShellInfo shellInfo = createShellInfo(ctx.getBranding());
    ctx.setShellInfo(shellInfo);
    return new DefaultShell(ctx.getShellInfo(), ctx.getBranding(), ctx.getCommandExecutor(), terminal, ctx.getEnvironment(), ctx.getIo());
  }
View Full Code Here

Examples of org.apache.geronimo.twiddle.command.CommandExecutor

        }
       
        this.io = io;
        this.world = world;
        this.container = new CommandContainer();
        this.executor = new CommandExecutor(container);
       
        // Make sure the default realm is there
        try {
            world.newRealm(Command.DEFAULT_CLASS_REALM);
            log.debug("Created new default class-realm");
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.