@Override public void restart() throws Exception { if (brokerService.isRestartAllowed()) { brokerService.requestRestart(); brokerService.stop(); } else { throw new Exception("Restart is not allowed"); } }
protected void stopBroker() { // we can no longer keep the lock so lets fail LOG.error("{}, no longer able to keep the exclusive lock so giving up being a master", brokerService.getBrokerName()); try { if( brokerService.isRestartAllowed() ) { brokerService.requestRestart(); } brokerService.stop(); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker"); } }
@Override public void run() { try { if( broker.isRestartAllowed() ) { broker.requestRestart(); } broker.setSystemExitOnShutdown(isSystemExitOnShutdown()); broker.stop(); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker", e); } } }.start();
@Override public void restart() throws Exception { if (brokerService.isRestartAllowed()) { brokerService.requestRestart(); brokerService.stop(); } else { throw new Exception("Restart is not allowed"); } }
@Override public void restart() throws Exception { if (brokerService.isRestartAllowed()) { brokerService.requestRestart(); brokerService.stop(); } else { throw new Exception("Restart is not allowed"); } }
@Override public void restart() throws Exception { if (brokerService.isRestartAllowed()) { brokerService.requestRestart(); brokerService.stop(); } else { throw new Exception("Restart is not allowed"); } }
protected void stopBroker() { // we can no longer keep the lock so lets fail LOG.error("{}, no longer able to keep the exclusive lock so giving up being a master", brokerService.getBrokerName()); try { if( brokerService.isRestartAllowed() ) { brokerService.requestRestart(); } brokerService.stop(); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker"); } }
protected void stopBroker() { // we can no longer keep the lock so lets fail LOG.error("{}, no longer able to keep the exclusive lock so giving up being a master", brokerService.getBrokerName()); try { if( brokerService.isRestartAllowed() ) { brokerService.requestRestart(); } brokerService.stop(); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker"); } }
protected void stopBroker() { // we can no longer keep the lock so lets fail LOG.error("{}, no longer able to keep the exclusive lock so giving up being a master", brokerService.getBrokerName()); try { if( brokerService.isRestartAllowed() ) { brokerService.requestRestart(); } brokerService.stop(); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker"); } }
@Override public void run() { // Start up the server again if it shutdown. Perhaps // it has lost a Locker and wants a restart. if (started.get() && server != null) { if (server.getBroker().isRestartAllowed() && server.getBroker().isRestartRequested()) { LOG.info("Restarting broker '" + name + "' after shutdown on restart request"); if (!standalone) { discoveryAgent.setServices(new String[0]); } start(); } else if (stop_future == null || stop_future.isDone()) { // abnormal exit LOG.info("Broker '" + name + "' shut down, giving up being master"); try { updateCurator(curator); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } } } } });
@Override public void run() { try { if( broker.isRestartAllowed() ) { broker.requestRestart(); } broker.setSystemExitOnShutdown(isSystemExitOnShutdown()); broker.stop(); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker", e); } } }.start();
@Override public void run() { try { if( broker.isRestartAllowed() ) { broker.requestRestart(); } broker.setSystemExitOnShutdown(isSystemExitOnShutdown()); broker.stop(); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker", e); } } }.start();
@Override public void run() { try { if( broker.isRestartAllowed() ) { broker.requestRestart(); } broker.setSystemExitOnShutdown(isSystemExitOnShutdown()); broker.stop(); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker", e); } } }.start();
@Override public void run() { // Start up the server again if it shutdown. Perhaps // it has lost a Locker and wants a restart. if (started.get() && server != null) { if (server.getBroker().isRestartAllowed() && server.getBroker().isRestartRequested()) { info("Restarting broker '%s' after shutdown on restart request", name); if (!standalone) { discoveryAgent.setServices(new String[0]); } start(); } else { info("Broker '%s' shut down, giving up being master", name); try { updateCurator(curator); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } } } } });