Package org.jdesktop.wonderland.runner

Examples of org.jdesktop.wonderland.runner.Runner


            decname = URLDecoder.decode(runner, "UTF-8");
        } catch (IOException ioe) {
            throw new WebServiceException(ioe);
        }
       
        Runner r = rm.get(decname);
        if (r == null) {
            ResponseBuilder rb = Response.status(Status.NOT_ACCEPTABLE);
            return rb.entity("No such runner: " + runner).type("text/plain").build();
        }
        if (!(r instanceof BaseRemoteRunner)) {
View Full Code Here


                        @QueryParam(value="wait"String waitParam)
    {
        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");
View Full Code Here

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
    {
        String action = request.getParameter("action");
        String runnerName = request.getParameter("name");
        Runner runner = null;
       
        if (action == null) {
            action = "view";
        }
        if (runnerName != null) {
View Full Code Here

                        @QueryParam(value="name"String nameParam)
    {
        RunManager rm = RunManager.getInstance();

        try {
            Runner r = rm.get(runner);
            if (r == null) {
                throw new RunnerException("Request for unknown runner: " +
                                          runner);
            }
       
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.runner.Runner

Copyright © 2018 www.massapicom. 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.