public void stop () { shutdown(true); } public void run () {
public void shutdown () { shutdown(false); } public boolean running() {
public void startService() { getServer().shutdown (); } }
@Override protected void initService() throws Exception { try { // attempt to bind, if another instance is already bound, an // exception will get throwm ss = new ServerSocket(port); } catch (IOException e) { getLog().error("An instance of Q2 is already running. Shutting this instance"); getServer().shutdown(); } }
lockFile.delete(); getServer().shutdown();
@After public void tearDown() throws Exception { Thread.sleep(2000L); // let the thing run q2.shutdown(true); Thread.sleep(2000L); }
@Test public void testShutdown1() throws Throwable { String[] args = new String[1]; args[0] = "undeploed:"; Q2 q2 = new Q2(args); q2.shutdown(); } }
@Test public void testShutdown() throws Throwable { String[] args = new String[1]; args[0] = "testString"; Q2 q2 = new Q2(args); q2.shutdown(true); }
public void exec(CLIContext cli, String[] args) throws IOException { boolean shutdown; if (cli.isInteractive() && cli.getOutputStream() != System.out) { cli.println ("Can't shutdown remotely"); return; } if (hasOption(args, "-f", "--force", "-fq")) { shutdown = true; } else { shutdown = cli.confirm("Confirm shutdown (Yes/No) ? "); } if (shutdown) { if (!hasOption (args, "-q", "--quiet", "-fq")) cli.println("Shutting down."); cli.getCLI().getQ2().shutdown(); } else { cli.println("Q2 will continue running."); } }
public void run () { try { Interpreter bsh = initBSH (); mux = (MUX) NameRegistrar.get ("mux." + cfg.get ("mux")); List suite = initSuite (getPersist().getChild ("test-suite")); runSuite (suite, mux, bsh); } catch (NameRegistrar.NotFoundException e) { LogEvent evt = getLog().createError (); evt.addMessage (e); evt.addMessage (NameRegistrar.getInstance()); Logger.log (evt); } catch (Throwable t) { getLog().error (t); } if (cfg.getBoolean ("shutdown")) getServer().shutdown(); } private void runSuite (List suite, MUX mux, Interpreter bsh)