@Override public void stop() throws Exception { ServiceStopper ss = new ServiceStopper(); ss.stop(discoveryAgent); ss.stop(next); ss.throwFirstException(); }
public void stop() throws Exception { if (stopped.compareAndSet(false, true)) { stopping.set(true); ServiceStopper stopper = new ServiceStopper(); try { doStop(stopper); } catch (Exception e) { stopper.onException(this, e); } finally { postStop(stopper); } stopped.set(true); started.set(false); stopping.set(false); for(ServiceListener l:this.serviceListeners) { l.stopped(this); } stopper.throwFirstException(); } }
public void onException(Object owner, Throwable e) { logError(owner, e); if (firstException == null) { firstException = e; } }
@Override public void stop() throws Exception { started = false; this.scheduler.cancel(purgeInactiveDestinationsTask); ServiceStopper ss = new ServiceStopper(); doStop(ss); ss.throwFirstException(); // clear the state clientIdSet.clear(); connections.clear(); destinations.clear(); brokerInfos.clear(); }
final ServiceStopper stopper = new ServiceStopper(); hook.run(); } catch (Throwable e) { stopper.onException(hook, e); stopper.stop(service); VMTransportFactory.stopped(getBrokerName()); if (broker != null) { stopper.stop(broker); broker = null; stopper.stop(getPersistenceAdapter()); persistenceAdapter = null; if (isUseJmx()) { stopper.stop(managementContext); managementContext = null; hook.run(); } catch (Throwable e) { stopper.onException(hook, e); stopper.throwFirstException();
/** * Stops the given service, catching any exceptions that are thrown. */ public void stop(Service service) { try { if (service != null) { service.stop(); } } catch (Exception e) { onException(service, e); } }
public void stopBeforeConnected()throws Exception{ masterActive.set(false); started.set(false); stoppedBeforeStart.set(true); ServiceStopper ss = new ServiceStopper(); ss.stop(localBroker); ss.stop(remoteBroker); }
@Override public void run() { try { ServiceStopper stopper = new ServiceStopper(); broker.stopAllConnectors(stopper); LOG.info("Successfully stopped transports on " + broker);
@Override protected void doStop(ServiceStopper stopper) throws Exception { for (PersistenceAdapter persistenceAdapter : adapters) { stopper.stop(persistenceAdapter); } }
ServiceStopper stopper = new ServiceStopper(); if (services != null) { for (Service service : services) { stopper.stop(service); VMTransportFactory.stopped(getBrokerName()); if (broker != null) { stopper.stop(broker); broker = null; tempDataStore = null; stopper.stop(persistenceAdapter); persistenceAdapter = null; slave = true; if (isUseJmx()) { stopper.stop(getManagementContext()); managementContext = null; hook.run(); } catch (Throwable e) { stopper.onException(hook, e); stopper.throwFirstException();
/** * Performs the given code to stop some service handling the exceptions * which may be thrown properly */ public void run(Callback stopClosure) { try { stopClosure.execute(); } catch (Throwable e) { onException(stopClosure, e); } }
@Override public void stop() throws Exception { started = false; this.scheduler.cancel(purgeInactiveDestinationsTask); ServiceStopper ss = new ServiceStopper(); doStop(ss); ss.throwFirstException(); // clear the state clientIdSet.clear(); connections.clear(); destinations.clear(); brokerInfos.clear(); }
public void run() { try { ServiceStopper stopper = new ServiceStopper(); broker.stopAllConnectors(stopper); } catch (Exception e) { LOG.warn("Failure occurred while stopping broker connectors", e); } } }.start();
@Override public void stop() throws Exception { if (!running.compareAndSet(true, false)) { return; } shuttingDown.set(true); ServiceStopper ss = new ServiceStopper(); ss.stop(remoteTransport); ss.stop(localTransport); ss.throwFirstException(); }
/** * Stops a list of services */ public void stopServices(List services) { for (Iterator iter = services.iterator(); iter.hasNext();) { Service service = (Service)iter.next(); stop(service); } }
ServiceStopper stopper = new ServiceStopper(); if (consumer != null) { try { consumer = null; } catch (JMSException e) { stopper.onException(this, e); session = null; } catch (JMSException e) { stopper.onException(this, e); connection = null; } catch (JMSException e) { stopper.onException(this, e); stopper.throwFirstException();
@Override protected void doStop(ServiceStopper stopper) { super.doStop(stopper); // lets remove any mbeans not yet removed for (Iterator<ObjectName> iter = registeredMBeans.iterator(); iter.hasNext();) { ObjectName name = iter.next(); try { managementContext.unregisterMBean(name); } catch (InstanceNotFoundException e) { LOG.warn("The MBean {} is no longer registered with JMX", name); } catch (Exception e) { stopper.onException(this, e); } } registeredMBeans.clear(); }
@Override public void stop() throws Exception { started = false; this.scheduler.cancel(purgeInactiveDestinationsTask); ServiceStopper ss = new ServiceStopper(); doStop(ss); ss.throwFirstException(); // clear the state clientIdSet.clear(); connections.clear(); destinations.clear(); brokerInfos.clear(); }
public void onException(Object owner, Throwable e) { logError(owner, e); if (firstException == null) { firstException = e; } }