Examples of RunnerException


Examples of com.cfinkel.reports.util.RunnerException

                    // convert / to .:
                    classString = classString.replaceAll("/", ".");

                    getCustomClassLoader().loadClass(classString);
                } catch (MalformedURLException e) {
                    throw new RunnerException("Malformed URL Exception", e);
                } catch (ClassNotFoundException e) {
                    throw new RunnerException("Class not found exception", e);
                }
            }
        };

        DirectoryIterator directoryIterator = new DirectoryIterator(Pattern.compile(".*\\.class"), runnerForFile);
View Full Code Here

Examples of com.cfinkel.reports.util.RunnerException

                            reportsDirectory.toURI().toURL().toString().length() - 1,
                            xmlString.length());

                    reportPaths.add(xmlString);
                } catch (MalformedURLException e) {
                    throw new RunnerException("malformedURLException", e);
                }
            }
        };

        DirectoryIterator directoryIterator = new DirectoryIterator(Pattern.compile(".*\\.xml"), runnerForFile);
View Full Code Here

Examples of org.jdesktop.wonderland.runner.RunnerException

        RunManager rm = RunManager.getInstance();

        try {
            Runner r = rm.get(runner);
            if (r == null) {
                throw new RunnerException("Request for unknown runner: " +
                                          runner);
            }
       
            if (!(r instanceof DarkstarRunner)) {
                throw new RunnerException("Only Darkstar runner supported");
            }

            DarkstarRunner dr = (DarkstarRunner) r;

            if (action.equalsIgnoreCase("snapshot")) {
                if (nameParam == null) {
                    throw new RunnerException("Name is required");
                }
                dr.createSnapshot(nameParam);
            } else if (action.equalsIgnoreCase("setwfsname")) {
                if (nameParam == null) {
                    throw new RunnerException("Name is required");
                }
                dr.setWFSName(nameParam);
            } else if (action.equalsIgnoreCase("coldstart")) {
                dr.forceColdstart();
            } else {
                throw new RunnerException("Unkown action " + action);     
            }
           
            ResponseBuilder rb = Response.ok();
            return rb.build();
        } catch (RunnerException re) {
View Full Code Here

Examples of org.jdesktop.wonderland.runner.RunnerException

    public void createSnapshot(String name) throws RunnerException {
        try {
            URL serviceURL = getDarkstarURL("snapshot", name);
            connectTo(serviceURL);
        } catch (IOException ex) {
            throw new RunnerException(ex);
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.runner.RunnerException

            // setup the other Darkstar properties
            try {
                setDarkstarProperties(props);
            } catch (IOException ioe) {
                throw new RunnerException(ioe);
            }
           
            // make sure coldstart is false, otherwise we'll overwrite
            // the database before taking the snapshot
            props.remove("sgs.coldstart");
View Full Code Here

Examples of org.jdesktop.wonderland.runner.RunnerException

                    if (w != null) {
                        waiters.add(w);
                    }
                }
            } else {
                throw new RunnerException("Unkown action " + action);     
            }

            // wait for a bit so that everything gets cleaned up
            try {
                Thread.sleep(getRestartDelay() * 1000);
 
View Full Code Here

Examples of org.jdesktop.wonderland.runner.RunnerException

        RunManager rm = RunManager.getInstance();

        try {
            Runner r = rm.get(runner);
            if (r == null) {
                throw new RunnerException("Request for unknown runner: " +
                                          runner);
            }
       
            boolean wait = false;
            if (waitParam != null) {
                wait = Boolean.parseBoolean(waitParam);
            }
            StatusWaiter waiter = null;
           
            if (action.equalsIgnoreCase("start")) {
                waiter = rm.start(r, wait);
            } else if (action.equalsIgnoreCase("stop")) {
                waiter = rm.stop(r, wait);
            } else if (action.equalsIgnoreCase("restart")) {
                // stop the runner and wait for it to stop
                waiter = rm.stop(r, true);
                if (waiter != null) {
                    waiter.waitFor();
                }
               
                // wait for a bit so that everything gets cleaned up
                try {
                    Thread.sleep(ActionResource.getRestartDelay() * 1000);
                } catch (InterruptedException ie) {
                    // oh well
                }

                // restart the runner
                waiter = rm.start(r, wait);
            } else if (action.equalsIgnoreCase("log")) {
                // read the log file
                if (r.getLogFile() != null) {
                    BufferedReader reader = new BufferedReader(
                                                new FileReader(r.getLogFile()));
                    StringBuffer sb = new StringBuffer();
                    String line;
                    while ((line = reader.readLine()) != null) {
                        sb.append(line);
                        sb.append("\n");
                    }

                    ResponseBuilder rb = Response.ok(sb.toString());
                    return rb.build();
                }
            } else {
                throw new RunnerException("Unkown action " + action);     
            }
           
            // if necessary, wait for the runner
            if (waiter != null) {
                waiter.waitFor();
View Full Code Here

Examples of processing.app.debug.RunnerException

                                              name,
                                              codeFolderPackages);
    } catch (FileNotFoundException fnfe) {
      fnfe.printStackTrace();
      String msg = "Build folder disappeared or could not be written";
      throw new RunnerException(msg);
    }

    // 2. run preproc on that code using the sugg class name
    //    to create a single .java file and write to buildpath

    String primaryClassName = null;

    try {
      // if (i != 0) preproc will fail if a pde file is not
      // java mode, since that's required
      String className = preprocessor.write();

      if (className == null) {
        throw new RunnerException("Could not find main class");
        // this situation might be perfectly fine,
        // (i.e. if the file is empty)
        //System.out.println("No class found in " + code[i].name);
        //System.out.println("(any code in that file will be ignored)");
        //System.out.println();

//      } else {
//        code[0].setPreprocName(className + ".cpp");
      }

      // store this for the compiler and the runtime
      primaryClassName = className + ".cpp";

    } catch (FileNotFoundException fnfe) {
      fnfe.printStackTrace();
      String msg = "Build folder disappeared or could not be written";
      throw new RunnerException(msg);
    } catch (RunnerException pe) {
      // RunnerExceptions are caught here and re-thrown, so that they don't
      // get lost in the more general "Exception" handler below.
      throw pe;

    } catch (Exception ex) {
      // TODO better method for handling this?
      System.err.println("Uncaught exception type:" + ex.getClass());
      ex.printStackTrace();
      throw new RunnerException(ex.toString());
    }

    // grab the imports from the code just preproc'd

    importedLibraries = new ArrayList<File>();
    for (String item : preprocessor.getExtraImports()) {
      File libFolder = (File) Base.importToLibraryTable.get(item);

      if (libFolder != null && !importedLibraries.contains(libFolder)) {
        importedLibraries.add(libFolder);
        classPath += Compiler.contentsToClassPath(libFolder);
        libraryPath += File.pathSeparator + libFolder.getAbsolutePath();
      }
    }
 

/*
    importedLibraries = new ArrayList<Library>(); //new Vector();
    String imports[] = preprocessor.extraImports;
    try {
      LibraryManager libraryManager = new LibraryManager();
      Collection libraries = libraryManager.getAll();
      for (Iterator i = libraries.iterator(); i.hasNext(); ) {
        Library library = (Library) i.next();
        File[] headerFiles = library.getHeaderFiles();

        for (int j = 0; j < headerFiles.length; j++)
          for (int k = 0; k < imports.length; k++)
            if (headerFiles[j].getName().equals(imports[k]) &&
              !importedLibraries.contains(library)) {
              importedLibraries.add(library); //.getFolder());
              //System.out.println("Adding library " + library.getName());
            }
      }
    } catch (IOException e) {
      System.err.println("Error finding libraries:");
      e.printStackTrace();
      throw new RunnerException(e.getMessage());
    }
*/
    // 3. then loop over the code[] and save each .java file

    for (SketchCode sc : code) {
//      System.out.println(sc.getFileName());
      if (sc.isExtension("c") || sc.isExtension("cpp") || sc.isExtension("h")) {
        // no pre-processing services necessary for java files
        // just write the the contents of 'program' to a .java file
        // into the build directory. uses byte stream and reader/writer
        // shtuff so that unicode bunk is properly handled
        String filename = sc.getFileName(); //code[i].name + ".java";
        try {
          Base.saveFile(sc.getProgram(), new File(buildPath, filename));
        } catch (IOException e) {
          e.printStackTrace();
          throw new RunnerException("Problem moving " + filename +
                                    " to the build folder");
        }
//        sc.setPreprocName(filename);

      } else if (sc.isExtension("pde") || sc.isExtension("ino")) {
View Full Code Here

Examples of processing.app.debug.RunnerException

      SketchCode code = getCode(i);
      if (code.isExtension("cpp")||code.isExtension("h")||code.isExtension("c")) {
        if (dotJavaFilename.equals(code.getFileName())) {
          codeIndex = i;
          codeLine = dotJavaLine;
          return new RunnerException(message, codeIndex, codeLine);
        }
      }
    }
   
    // If not the preprocessed file at this point, then need to get out
    if (!dotJavaFilename.equals(name + ".cpp") && !dotJavaFilename.equals(name + ".c") && !dotJavaFilename.equals(name + ".h")) {
      return null;
    }
   
    // if it's not a .cpp or .c file, codeIndex will still be 0
    // this section searches through the list of .pde files
    codeIndex = 0;
    for (int i = 0; i < getCodeCount(); i++) {
      SketchCode code = getCode(i);
     
      if (code.isExtension("pde")) {
        //        System.out.println("preproc offset is " + code.getPreprocOffset());
        //        System.out.println("looking for line " + dotJavaLine);
        if (code.getPreprocOffset() <= dotJavaLine) {
          codeIndex = i;
          //          System.out.println("i'm thinkin file " + i);
          codeLine = dotJavaLine - code.getPreprocOffset();
        }
      }
    }
    // could not find a proper line number, so deal with this differently.
    // but if it was in fact the .java file we're looking for, though,
    // send the error message through.
    // this is necessary because 'import' statements will be at a line
    // that has a lower number than the preproc offset, for instance.
    //    if (codeLine == -1 && !dotJavaFilename.equals(name + ".java")) {
    //      return null;
    //    }
    return new RunnerException(message, codeIndex, codeLine);
  }
View Full Code Here

Examples of processing.app.debug.RunnerException

    } catch (RunnerException e) {
      System.err.println("Couldn't determine program size: " + e.getMessage());
    }
   
    if (size > maxsize)
      throw new RunnerException(
                                "Sketch too big. Try to reduce the size");
  }
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.