Package org.jdesktop.wonderland.runner

Examples of org.jdesktop.wonderland.runner.StatusWaiter.waitFor()


            RunManager.getInstance().start(snapshot, false);

            // wait for the snapshot runner to exit, which it should do
            // as soon as it finishes starting up
            StatusWaiter waiter = new StatusWaiter(snapshot, Status.NOT_RUNNING);
            waiter.waitFor();
        } catch (InterruptedException ie) {
            // not much we can do here...
        } finally {
            synchronized(this) {
                snapshot = null;
View Full Code Here


        }
       
        if(runner.getStatus() != Status.NOT_RUNNING) {
            try {
                StatusWaiter waiter = RunManager.getInstance().stop(runner, true);
                waiter.waitFor(Status.NOT_RUNNING);
            } catch (InterruptedException ex) {
                LOGGER.warning("Wait for NOT_RUNNING interrupted!\n" +ex.getLocalizedMessage());
            } catch (RunnerException ex) {
                LOGGER.warning("Error stopping server!\n" +ex);
            }           
View Full Code Here

       
        if(runner.getStatus() == Status.NOT_RUNNING) {
            try {
               
                StatusWaiter waiter = RunManager.getInstance().start(runner, true);
                waiter.waitFor(Status.RUNNING);
            } catch (InterruptedException ex) {
                LOGGER.warning("Wait for RUNNING interrupted!\n"+ex);
            } catch( RunnerException ex) {
                LOGGER.warning("Error starting server!\n"+ex);               
            }
View Full Code Here

        if (runner.getStatus() != Status.NOT_RUNNING) {
            if (restart) {
                try {
                    // stop the runner, and wait for it to stop
                    StatusWaiter sw = RunManager.getInstance().stop(runner, true);
                    sw.waitFor();
                } catch (RunnerException re) {
                    logger.log(Level.WARNING, "Error stopping " + runner, re);
                    return new SnapshotResult("Error stopping runner", null);
                } catch (InterruptedException ie) {
                    // just ignore?
View Full Code Here

                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);
 
View Full Code Here

                throw new RunnerException("Unkown action " + action);     
            }
           
            // if necessary, wait for the runner
            if (waiter != null) {
                waiter.waitFor();
            }
           
            ResponseBuilder rb = Response.ok();
            return rb.build();
        } catch (RunnerException re) {
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.