.add(new JsonModule()) .add(new JaxrsModule(true)) .add(new MBeanModule()) .add(new TestingJmxModule()) .add(new EventModule())
new MBeanModule(), new DriftNettyClientModule(), binder -> {
new MBeanModule(), new JsonModule(), new CassandraClientModule(catalogName),
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); } }
Bootstrap app = new Bootstrap( new EventModule(), new MBeanModule(), new JsonModule(), new HiveClientModule(catalogName),
new JsonModule(), new JaxrsModule(true), new MBeanModule(), new JmxModule(), new JmxHttpModule(),
@Override protected void configure() { install(new MBeanModule()); bind(MBeanServer.class).to(TestingMBeanServer.class).in(Scopes.SINGLETON); } }
@Override protected void configure() { install(new MBeanModule()); bind(MBeanServer.class).to(TestingMBeanServer.class).in(Scopes.SINGLETON); } }
protected void installJMX() { final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); binder().bind(MBeanServer.class).toInstance(mBeanServer); install(new MBeanModule()); }
@Override public void configure(Binder binder) { binder.install(new MBeanModule()); // bind the configuration configBinder(binder).bindConfig(H2EmbeddedDataSourceConfig.class, annotation, propertyPrefix); // Bind the datasource binder.bind(DataSource.class).annotatedWith(annotation).toProvider(new H2EmbeddedDataSourceProvider(annotation)).in(Scopes.SINGLETON); newExporter(binder).export(DataSource.class).annotatedWith(annotation).withGeneratedName(); // Bind aliases Key<DataSource> key = Key.get(DataSource.class, annotation); for (Class<? extends Annotation> alias : aliases) { binder.bind(DataSource.class).annotatedWith(alias).to(key); } }
@Override public void configure(Binder binder) { binder.install(new MBeanModule()); // bind the configuration configBinder(binder).bindConfig(H2EmbeddedDataSourceConfig.class, annotation, propertyPrefix); // Bind the datasource binder.bind(DataSource.class).annotatedWith(annotation).toProvider(new H2EmbeddedDataSourceProvider(annotation)).in(Scopes.SINGLETON); newExporter(binder).export(DataSource.class).annotatedWith(annotation).withGeneratedName(); // Bind aliases Key<DataSource> key = Key.get(DataSource.class, annotation); for (Class<? extends Annotation> alias : aliases) { binder.bind(DataSource.class).annotatedWith(alias).to(key); } }
@Override protected void configure() { install(Modules.override(new MBeanModule()).with(new Module() { @Override public void configure(final Binder binder) { binder.bind(MBeanExporter.class).to(LifecycledMBeanExporter.class).in(Scopes.SINGLETON); } })); }
@Override public void configure(Binder binder) { binder.install(new MBeanModule()); // bind the configuration configBinder(binder).bindConfig(MySqlDataSourceConfig.class, annotation, type); // bind the service selector discoveryBinder(binder).bindSelector(type); // Bind the datasource binder.bind(DataSource.class).annotatedWith(annotation).toProvider(new MySqlDataSourceProvider(type, annotation)).in(Scopes.SINGLETON); newExporter(binder).export(DataSource.class).annotatedWith(annotation).withGeneratedName(); // Bind aliases Key<DataSource> key = Key.get(DataSource.class, annotation); for (Class<? extends Annotation> alias : aliases) { binder.bind(DataSource.class).annotatedWith(alias).to(key); } }
@Override public void configure(Binder binder) { binder.install(new MBeanModule()); // bind the configuration configBinder(binder).bindConfig(PostgreSqlDataSourceConfig.class, annotation, type); // bind the service selector discoveryBinder(binder).bindSelector(type); // Bind the datasource binder.bind(DataSource.class).annotatedWith(annotation).toProvider(new PostgreSqlDataSourceProvider(type, annotation)).in(Scopes.SINGLETON); newExporter(binder).export(DataSource.class).annotatedWith(annotation).withGeneratedName(); // Bind aliases Key<DataSource> key = Key.get(DataSource.class, annotation); for (Class<? extends Annotation> alias : aliases) { binder.bind(DataSource.class).annotatedWith(alias).to(key); } }
@Override public void configure(Binder binder) { binder.install(new MBeanModule()); // bind the configuration configBinder(binder).bindConfig(PostgreSqlDataSourceConfig.class, annotation, type); // bind the service selector discoveryBinder(binder).bindSelector(type); // Bind the datasource binder.bind(DataSource.class).annotatedWith(annotation).toProvider(new PostgreSqlDataSourceProvider(type, annotation)).in(Scopes.SINGLETON); newExporter(binder).export(DataSource.class).annotatedWith(annotation).withGeneratedName(); // Bind aliases Key<DataSource> key = Key.get(DataSource.class, annotation); for (Class<? extends Annotation> alias : aliases) { binder.bind(DataSource.class).annotatedWith(alias).to(key); } }
@Override public void configure(Binder binder) { binder.install(new MBeanModule()); // bind the configuration configBinder(binder).bindConfig(MySqlDataSourceConfig.class, annotation, type); // bind the service selector discoveryBinder(binder).bindSelector(type); // Bind the datasource binder.bind(DataSource.class).annotatedWith(annotation).toProvider(new MySqlDataSourceProvider(type, annotation)).in(Scopes.SINGLETON); newExporter(binder).export(DataSource.class).annotatedWith(annotation).withGeneratedName(); // Bind aliases Key<DataSource> key = Key.get(DataSource.class, annotation); for (Class<? extends Annotation> alias : aliases) { binder.bind(DataSource.class).annotatedWith(alias).to(key); } }
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); }
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) 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); } } }