.add(new JsonModule()) .add(new JaxrsModule(true)) .add(new MBeanModule()) .add(new TestingJmxModule()) .add(new EventModule())
@Override protected final void configure() { builder = newExporter(binder()); bind(GuiceMBeanExporter.class).asEagerSingleton(); bind(MBeanExporter.class).in(Scopes.SINGLETON); newOptionalBinder(binder(), ObjectNameGenerator.class); newSetBinder(binder(), new TypeLiteral<SetMapping<?>>() {}); newSetBinder(binder(), new TypeLiteral<MapMapping<?, ?>>() {}); configureMBeans(); }
@Override protected final void configure() { builder = newExporter(binder()); install(new InternalMBeanModule()); configureMBeans(); }
public void configure(Binder binder) { binder.disableCircularProxies(); binder.requireExplicitBindings(); binder.bind(Agent.class).in(Scopes.SINGLETON); MBeanModule.newExporter(binder).export(Agent.class).withGeneratedName(); binder.bind(AgentResource.class).in(Scopes.SINGLETON); binder.bind(SlotResource.class).in(Scopes.SINGLETON); binder.bind(AssignmentResource.class).in(Scopes.SINGLETON); binder.bind(LifecycleResource.class).in(Scopes.SINGLETON); binder.bind(VersionConflictExceptionMapper.class).in(Scopes.SINGLETON); binder.bind(DeploymentManagerFactory.class).to(DirectoryDeploymentManagerFactory.class).in(Scopes.SINGLETON); binder.bind(LifecycleManager.class).to(LauncherLifecycleManager.class).in(Scopes.SINGLETON); binder.bind(ServiceInventoryResource.class).in(Scopes.SINGLETON); ConfigurationModule.bindConfig(binder).to(AgentConfig.class); } }
@Override protected final void configure() { builder = newExporter(binder()); bind(GuiceMBeanExporter.class).asEagerSingleton(); bind(MBeanExporter.class).in(Scopes.SINGLETON); newOptionalBinder(binder(), ObjectNameGenerator.class); newSetBinder(binder(), new TypeLiteral<SetMapping<?>>() {}); newSetBinder(binder(), new TypeLiteral<MapMapping<?, ?>>() {}); configureMBeans(); }
@Override protected void configure() { bind(MBeanServer.class).toInstance(ManagementFactory.getPlatformMBeanServer()); bind(AreciboProfile.class).asEagerSingleton(); bind(AreciboMBeanExporter.class).asEagerSingleton(); bind(MBeanExporter.class).to(AreciboMBeanExporter.class); Multibinder<AnnotationType> multiBinder = newSetBinder(binder(), AnnotationType.class); for (AnnotationType annotationType : annotationTypes) { multiBinder.addBinding().toInstance(annotationType); } ExportBuilder builder = MBeanModule.newExporter(binder()); builder.export(AreciboProfile.class).as(profileMbeanName); } }
new MBeanModule(), new DriftNettyClientModule(), binder -> {
/** * Configures a {@link com.google.inject.Binder} via the exposed methods. */ @Override protected void configure() { final ExportBuilder builder = MBeanModule.newExporter(binder()); builder.export(CollectorController.class).as("com.ning.metrics.eventtracker:name=CollectorController"); } }
new MBeanModule(), new JsonModule(), new CassandraClientModule(catalogName),
@Override public void configure(Binder binder) { // bind service inventory binder.bind(ServiceInventory.class).in(Scopes.SINGLETON); bindConfig(binder).to(ServiceInventoryConfig.class); // for legacy configurations bindConfig(binder).to(DiscoveryClientConfig.class); // bind discovery client and dependencies binder.bind(DiscoveryLookupClient.class).to(HttpDiscoveryLookupClient.class).in(Scopes.SINGLETON); binder.bind(DiscoveryAnnouncementClient.class).to(HttpDiscoveryAnnouncementClient.class).in(Scopes.SINGLETON); jsonCodecBinder(binder).bindJsonCodec(ServiceDescriptorsRepresentation.class); jsonCodecBinder(binder).bindJsonCodec(Announcement.class); // bind the http client httpClientBinder(binder).bindAsyncHttpClient("discovery", ForDiscoveryClient.class); // bind announcer binder.bind(Announcer.class).in(Scopes.SINGLETON); // Must create a multibinder for service announcements or construction will fail if no // service announcements are bound, which is legal for processes that don't have public services Multibinder.newSetBinder(binder, ServiceAnnouncement.class); binder.bind(ServiceSelectorFactory.class).to(CachingServiceSelectorFactory.class).in(Scopes.SINGLETON); MBeanModule.newExporter(binder).export(ServiceInventory.class).withGeneratedName(); }
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); } }
@Override protected void installJMX() { super.installJMX(); final ExportBuilder builder = MBeanModule.newExporter(binder()); for (final Class beanClass : beans) { builder.export(beanClass).withGeneratedName(); } if (log4jEnabled) { builder.export(Log4JMBean.class).withGeneratedName(); } }
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); } })); }