.add(new TestingHttpServerModule(parseInt(coordinator ? coordinatorPort : "0"))) .add(new JsonModule()) .add(new JaxrsModule(true)) .add(new MBeanModule()) .add(new TestingJmxModule())
public static void start(Module... extraModules) { Bootstrap app = new Bootstrap(ImmutableList.<Module>builder() .add(new NodeModule()) .add(new HttpServerModule()) .add(new JsonModule()) .add(new JaxrsModule(true)) .add(new MBeanModule()) .add(new JmxModule()) .add(new LogJmxModule()) .add(new TraceTokenModule()) .add(new EventModule()) .add(new ProxyModule()) .add(extraModules) .build()); Logger log = Logger.get(PrestoProxy.class); try { app.strictConfig().initialize(); log.info("======== SERVER STARTED ========"); } catch (Throwable t) { log.error(t); System.exit(1); } }
new HttpServerModule(), new JsonModule(), new JaxrsModule(true), new MBeanModule(), new JmxModule(),
new TraceTokenModule(), new JsonModule(), new JaxrsModule(true), new FailureDetectorModule(), new Module()
new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(true), new TestingJmxModule(), new ProxyModule());
public static void start(Module... extraModules) { Bootstrap app = new Bootstrap(ImmutableList.<Module>builder() .add(new NodeModule()) .add(new HttpServerModule()) .add(new JsonModule()) .add(new JaxrsModule(true)) .add(new MBeanModule()) .add(new JmxModule()) .add(new LogJmxModule()) .add(new TraceTokenModule()) .add(new EventModule()) .add(new ProxyModule()) .add(extraModules) .build()); Logger log = Logger.get(PrestoProxy.class); try { app.strictConfig().initialize(); log.info("======== SERVER STARTED ========"); } catch (Throwable t) { log.error(t); System.exit(1); } }
private static TestingHttpServer createServer(final TestResource resource) { try { List<Module> modules = ImmutableList.<Module>builder() .add(new TestingNodeModule()) .add(new JaxrsModule(true)) .add(new JsonModule()) .add(new TestingHttpServerModule()) .add(binder -> jaxrsBinder(binder).bindInstance(resource)) .build(); return new Bootstrap(modules) .strictConfig() .doNotInitializeLogging() .quiet() .initialize() .getInstance(TestingHttpServer.class); } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } } }
@BeforeClass public void setup() throws Exception { Bootstrap app = new Bootstrap( new TestingNodeModule(), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(true), new JmxHttpModule(), binder -> binder.bind(MBeanServer.class).toInstance(mbeanServer)); Injector injector = app .quiet() .strictConfig() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); server = injector.getInstance(TestingHttpServer.class); client = new JettyHttpClient(); }
public TestingDiscoveryServer(String environment) throws Exception { Bootstrap app = new Bootstrap( new MBeanModule(), new TestingNodeModule(environment), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(true), new TestingJmxModule(), new DiscoveryModule(), new EmbeddedDiscoveryModule()); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperty("discovery.store-cache-ttl", "0ms") .quiet() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); server = injector.getInstance(TestingHttpServer.class); }
@BeforeClass public void startServer() throws Exception { tempDir = createTempDir("agent"); Map<String, String> properties = ImmutableMap.<String, String>builder() .put("agent.id", UUID.randomUUID().toString()) .put("agent.coordinator-uri", "http://localhost:9999/") .put("agent.slots-dir", tempDir.getAbsolutePath()) .put("discovery.uri", "fake://server") .build(); Injector injector = Guice.createInjector( new TestingDiscoveryModule(), new TestingNodeModule(), new JsonModule(), new TestingHttpServerModule(), new JaxrsModule(), new EventModule(), new AgentMainModule(), new ConfigurationModule(new ConfigurationFactory(properties))); server = injector.getInstance(TestingHttpServer.class); agent = injector.getInstance(Agent.class); server.start(); client = new ApacheHttpClient(); installationHelper = new InstallationHelper(); appleInstallation = installationHelper.getAppleInstallation(); bananaInstallation = installationHelper.getBananaInstallation(); }
@BeforeClass public void startServer() throws Exception { tempDir = createTempDir("agent"); Map<String, String> properties = ImmutableMap.<String, String>builder() .put("agent.id", UUID.randomUUID().toString()) .put("agent.coordinator-uri", "http://localhost:9999/") .put("agent.slots-dir", tempDir.getAbsolutePath()) .put("discovery.uri", "fake://server") .build(); Injector injector = Guice.createInjector( new TestingDiscoveryModule(), new TestingNodeModule(), new JsonModule(), new TestingHttpServerModule(), new JaxrsModule(), new EventModule(), new AgentMainModule(), new ConfigurationModule(new ConfigurationFactory(properties))); server = injector.getInstance(TestingHttpServer.class); agent = injector.getInstance(Agent.class); server.start(); client = new JettyHttpClient(); installationHelper = new InstallationHelper(); appleInstallation = installationHelper.getAppleInstallation(); bananaInstallation = installationHelper.getBananaInstallation(); }
@BeforeClass public void setup() throws Exception { Bootstrap app = new Bootstrap( new TestingNodeModule(), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(true), new JmxHttpModule(), binder -> binder.bind(MBeanServer.class).toInstance(mbeanServer)); Injector injector = app .quiet() .strictConfig() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); server = injector.getInstance(TestingHttpServer.class); client = new JettyHttpClient(); }
public void start() throws Exception { Map<String, String> agentProperties = ImmutableMap.<String, String>builder() .put("node.environment", "test") .put("node.id", instance.getInstanceId()) .put("node.location", instance.getLocation()) .put("agent.slots-dir", new File(tempDir, "slots").getAbsolutePath()) .put("agent.resources-file", resourcesFile.getAbsolutePath()) .build(); Injector agentInjector = Guice.createInjector(new NodeModule(), new TestingHttpServerModule(), new TestingDiscoveryModule(), new JsonModule(), new JaxrsModule(), new EventModule(), new AgentMainModule(), new ConfigurationModule(new ConfigurationFactory(agentProperties))); agentServer = agentInjector.getInstance(TestingHttpServer.class); agent = agentInjector.getInstance(Agent.class); agentServer.start(); // update instance URIs to new http server instance = new Instance(instance.getInstanceId(), instance.getInstanceType(), instance.getLocation(), agentServer.getBaseUrl(), agentServer.getBaseUrl()); }
@BeforeMethod public void setup() throws Exception { Bootstrap app = new Bootstrap( new TestingNodeModule(), new InMemoryEventModule(), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(true), new MainModule()); Injector injector = app .strictConfig() .doNotInitializeLogging() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); server = injector.getInstance(TestingHttpServer.class); store = injector.getInstance(PersonStore.class); eventClient = injector.getInstance(InMemoryEventClient.class); client = new JettyHttpClient(); }
public static void main(String[] args) throws Exception { try { Bootstrap app = new Bootstrap( new DiscoveryModule(), new NodeModule(), new HttpServerModule(), new HttpEventModule(), new JsonModule(), new JaxrsModule(), new MBeanModule(), new JmxModule(), new AgentMainModule()); app.strictConfig().initialize(); } catch (Exception e) { log.error(e, "Startup failed"); System.exit(1); } } }
public static void main(String[] args) { try { Bootstrap app = new Bootstrap( new MBeanModule(), new NodeModule(), new HttpServerModule(), new JaxrsModule(true), new JsonModule(), new JmxModule(), new JmxHttpRpcModule(), new DiscoveryServerModule(), new HttpEventModule(), new TraceTokenModule(), new DiscoveryModule() ); Injector injector = app.strictConfig().initialize(); injector.getInstance(Announcer.class).start(); } catch (Throwable t) { log.error(t); System.exit(1); } } }
@BeforeMethod public void setup() throws Exception { temporary = createTempDir(); Map<String, String> properties = ImmutableMap.<String, String>builder() .put("backup.http.uri", "http://localhost:8080") .build(); Bootstrap app = new Bootstrap( new TestingNodeModule(), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(true), binder -> jaxrsBinder(binder).bind(TestingHttpBackupResource.class), override(new HttpBackupModule()).with(new TestingModule())); Injector injector = app .strictConfig() .setRequiredConfigurationProperties(properties) .doNotInitializeLogging() .quiet() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); store = injector.getInstance(BackupStore.class); }
public static void main(String[] args) throws Exception { Bootstrap app = new Bootstrap( new NodeModule(), new DiscoveryModule(), new HttpServerModule(), new JsonModule(), new JaxrsModule(true), new MBeanModule(), new JmxModule(), new JmxHttpModule(), new JmxHttpRpcModule(), new LogJmxModule(), new HttpEventModule(), new TraceTokenModule(), new MainModule()); try { Injector injector = app.strictConfig().initialize(); injector.getInstance(Announcer.class).start(); } catch (Throwable e) { log.error(e); System.exit(1); } } }
public static void main(String[] args) throws Exception { try { Bootstrap app = new Bootstrap( new NodeModule(), new HttpServerModule(), new HttpEventModule(), new DiscoveryModule(), new JsonModule(), new JaxrsModule(), new MBeanModule(), new JmxModule(), new CoordinatorMainModule(), installIfPropertyEquals(new StaticProvisionerModule(), "coordinator.provisioner", "static"), installIfPropertyEquals(new AwsProvisionerModule(), "coordinator.provisioner", "aws")); app.strictConfig().initialize(); } catch (Throwable e) { log.error(e, "Startup failed"); System.exit(1); } } }
@BeforeMethod public void setup() throws Exception { Bootstrap app = new Bootstrap( new TestingNodeModule(), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(true), new JmxHttpModule(), new JmxModule(), new MainModule()); Injector injector = app .strictConfig() .doNotInitializeLogging() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); server = injector.getInstance(TestingHttpServer.class); client = new JettyHttpClient(); }