Examples of AlgorithmExecutionException


Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

                Data data = new BasicData(getDataset(),format);
                data.getMetadata().put(DataProperty.LABEL, label);
           
                return new Data[]{data};
            } catch (IOException e) {
                throw new AlgorithmExecutionException(e);
            }
        }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

      if (entries.contains(platformPath)) {
        path = platformPath;
      }

      if (path == null) {
        throw new AlgorithmExecutionException("Unable to find compatible executable");
      } else {
        // logger.log(LogService.LOG_DEBUG, "base path: "+path+
        // "\n\t"+dir.getAbsolutePath() + "\n\n");
        copyDir(dir, path, 0);
      }
    } catch (IOException e) {
      throw new AlgorithmExecutionException(e.getMessage(), e);
    }
  }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

    if (new File("/bin/chmod").exists()) {
      try {
        String executable = baseDir + properties.getProperty("executable");
        Runtime.getRuntime().exec("/bin/chmod +x " + executable).waitFor();
      } catch (IOException e) {
        throw new AlgorithmExecutionException(e);
      } catch (InterruptedException e) {
        throw new AlgorithmExecutionException(e);
      }
    }
  }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

      processBuilder.directory(new File(baseDirPath));
      process = processBuilder.start();
     
      process.getOutputStream().close();
    } catch (IOException e1) {
      throw new AlgorithmExecutionException(e1.getMessage(), e1);
    }

    //monitor the process, printing its stdout and stderr to console
   
    monitor.start(ProgressMonitor.CANCELLABLE, -1);

    InputStream in = process.getInputStream();
    StringBuffer inBuffer = new StringBuffer();

    InputStream err = process.getErrorStream();
    StringBuffer errBuffer = new StringBuffer();

    Integer exitValue = null;
    boolean killedOnPurpose = false;
    //while the process is still running...
    while (!killedOnPurpose && exitValue == null) {
      //print its output, and watch to see if it has finished/died.
     
      inBuffer = logStream(LogService.LOG_INFO, in, inBuffer);
      errBuffer = logStream(LogService.LOG_ERROR, err, errBuffer);

      if (monitor.isCanceled()) {
        killedOnPurpose = true;
        process.destroy();
      }

      try {
        int value = process.exitValue();
        exitValue = new Integer(value);
      } catch (IllegalThreadStateException e) {
        // thrown if the process isn't done.
        // kinda nasty, but there looks to be no other option.
      }

      try {
        Thread.sleep(100);
      } catch (InterruptedException e) {
        // possibly normal operation
      }
    }

    monitor.done();

    // if the process failed unexpectedly...
    if (process.exitValue() != 0 && !killedOnPurpose) {
      throw new AlgorithmExecutionException(
          "Algorithm exited unexpectedly (exit value: "
          + process.exitValue()
          + "). Please check the console window for any error messages.");
    }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

        buffer = log(logLevel, buffer);
      }
    } catch (EOFException e) {
      // normal operation
    } catch (IOException e) {
      throw new AlgorithmExecutionException(
          "Error when processing the algorithm's screen output", e);
    }

    return buffer;
  }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

           
            //run it!
            return runner.execute();
  
        } catch (IOException e) {
            throw new AlgorithmExecutionException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

  public Data[] execute() throws AlgorithmExecutionException {
    try {
      return this.fileLoader.loadFilesFromUserSelection(
        this.bundleContext, this.ciShellContext, this.logger, this.progressMonitor, false);
    } catch (FileLoadException e) {
      throw new AlgorithmExecutionException(e.getMessage(), e);
    }
  }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

  throws AlgorithmExecutionException {
    Connection connection;
    try {
      connection = database.getConnection();
    } catch (SQLException e) {
      throw new AlgorithmExecutionException(messageIfError, e);
    }
    return connection;
  }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

  public static Statement createStatement(Connection connection, String messageIfError)
  throws AlgorithmExecutionException {
    try {
      return connection.createStatement();
    } catch (SQLException e) {
      throw new AlgorithmExecutionException(messageIfError, e);
    }
  }
View Full Code Here

Examples of org.cishell.framework.algorithm.AlgorithmExecutionException

      String messageIfError)
  throws AlgorithmExecutionException {
    try {
      return connection.createStatement(resultSetType, resultSetConcurrency);
    } catch (SQLException e) {
      throw new AlgorithmExecutionException(messageIfError, 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.