public static void dispose(Service service) { try { service.stop(); } catch (Exception e) { LOG.debug("Could not stop service: " + service + ". Reason: " + e, e); } }
service.start();
/** * 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 start() throws Exception { if (startCounter.addAndGet(1) == 1) { if (startEmbeddRegistry) { jetty = createEmbeddedJettyServer(); Map<String, Object> props = new HashMap<String, Object>(); props.put("agent", this); IntrospectionSupport.setProperties(jetty, props); jetty.start(); } running.set(true); thread = new Thread("HTTPDiscovery Agent") { @Override public void run() { while (running.get()) { try { update(); Thread.sleep(updateInterval); } catch (InterruptedException e) { return; } } } }; thread.setDaemon(true); thread.start(); } }
public static void dispose(Service service) { try { service.stop(); } catch (Exception e) { LOG.debug("Could not stop service: " + service + ". Reason: " + e, e); } }
props.put("agent", this); IntrospectionSupport.setProperties(jetty, props); jetty.start();
public static void dispose(Service service) { try { service.stop(); } catch (Exception e) { LOG.debug("Could not stop service: " + service + ". Reason: " + e, e); } }
props.put("agent", this); IntrospectionSupport.setProperties(jetty, props); jetty.start();
public static void dispose(Service service) { try { service.stop(); } catch (Exception e) { LOG.debug("Could not stop service: " + service + ". Reason: " + e, e); } }
props.put("agent", this); IntrospectionSupport.setProperties(jetty, props); jetty.start();
public static void dispose(Service service) { try { service.stop(); } catch (Exception e) { LOG.debug("Could not stop service: " + service + ". Reason: " + e, e); } }
public void stop() throws Exception { if (startCounter.decrementAndGet() == 0) { running.set(false); if (thread != null) { thread.join(updateInterval * 3); thread = null; } if (jetty != null) { jetty.stop(); jetty = null; } } }
/** * 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); } }
service.start();
/** * 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); } }
if (service instanceof MasterConnector) { configureService(service); service.start();