/** * 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); } }
/** * 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 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 protected void handleStop(ServiceStopper stopper) throws Exception { for (Iterator<NetworkBridge> i = bridges.values().iterator(); i.hasNext();) { NetworkBridge bridge = i.next(); try { bridge.stop(); } catch (Exception e) { stopper.onException(this, e); } } bridges.clear(); activeEvents.clear(); try { this.discoveryAgent.stop(); } catch (Exception e) { stopper.onException(this, e); } super.handleStop(stopper); }
protected void handleStop(ServiceStopper stopper) throws Exception { super.handleStop(stopper); if (bridge != null) { try { bridge.stop(); } catch (Exception e) { stopper.onException(this, e); } } if (remoteTransport != null) { try { remoteTransport.stop(); } catch (Exception e) { stopper.onException(this, e); } } if (localTransport != null) { try { localTransport.stop(); } catch (Exception e) { stopper.onException(this, e); } } }
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(); } }
protected void doStop(ServiceStopper stopper) throws Exception { super.doStop(stopper); if (socket != null) { try { socket.leaveGroup(getMulticastAddress()); } catch (IOException e) { stopper.onException(this, e); } socket.close(); } }
hook.run(); } catch (Throwable e) { stopper.onException(hook, e); hook.run(); } catch (Throwable e) { stopper.onException(hook, e);
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
protected void doStop(ServiceStopper stopper) throws Exception { super.doStop(stopper); if (socket != null) { try { socket.leaveGroup(getMulticastAddress()); } catch (IOException e) { stopper.onException(this, e); } socket.close(); } }
protected void doStop(ServiceStopper stopper) throws Exception { super.doStop(stopper); if (socket != null) { try { socket.leaveGroup(getMulticastAddress()); } catch (IOException e) { stopper.onException(this, e); } socket.close(); } }
protected void doStop(ServiceStopper stopper) throws Exception { super.doStop(stopper); if (socket != null) { try { socket.leaveGroup(getMulticastAddress()); } catch (IOException e) { stopper.onException(this, e); } socket.close(); } }
protected void doStop(ServiceStopper stopper) throws Exception { super.doStop(stopper); if (socket != null) { try { socket.leaveGroup(getMulticastAddress()); } catch (IOException e) { stopper.onException(this, e); } socket.close(); } }