@Override protected void run(Environment environment, Namespace namespace, T configuration) throws Exception { final Server server = configuration.getServerFactory().build(environment); try { server.addLifeCycleListener(new LifeCycleListener()); cleanupAsynchronously(); server.start(); } catch (Exception e) { LOGGER.error("Unable to start server, shutting down", e); try { server.stop(); } catch (Exception e1) { LOGGER.warn("Failure during stop server", e1); } try { cleanup(); } catch (Exception e2) { LOGGER.warn("Failure during cleanup", e2); } throw e; } }
@Override protected void run(Bootstrap<T> bootstrap, Namespace namespace, T configuration) throws Exception { final Environment environment = new Environment(bootstrap.getApplication().getName(), bootstrap.getObjectMapper(), bootstrap.getValidatorFactory(), bootstrap.getMetricRegistry(), bootstrap.getClassLoader(), bootstrap.getHealthCheckRegistry()); configuration.getMetricsFactory().configure(environment.lifecycle(), bootstrap.getMetricRegistry()); configuration.getServerFactory().configure(environment); bootstrap.run(configuration, environment); application.run(configuration, environment); run(environment, namespace, configuration); }
@Override protected void run(Bootstrap<T> bootstrap, Namespace namespace, T configuration) throws Exception { final Environment environment = new Environment(bootstrap.getApplication().getName(), bootstrap.getObjectMapper(), bootstrap.getValidatorFactory().getValidator(), bootstrap.getMetricRegistry(), bootstrap.getClassLoader(), bootstrap.getHealthCheckRegistry()); configuration.getMetricsFactory().configure(environment.lifecycle(), bootstrap.getMetricRegistry()); configuration.getServerFactory().configure(environment); bootstrap.run(configuration, environment); application.run(configuration, environment); run(environment, namespace, configuration); }
@Override protected void run(Environment environment, Namespace namespace, T configuration) throws Exception { final Server server = configuration.getServerFactory().build(environment); try { server.addLifeCycleListener(new LifeCycleListener()); cleanupAsynchronously(); server.start(); } catch (Exception e) { LOGGER.error("Unable to start server, shutting down", e); try { server.stop(); } catch (Exception e1) { LOGGER.warn("Failure during stop server", e1); } try { cleanup(); } catch (Exception e2) { LOGGER.warn("Failure during cleanup", e2); } throw e; } }