public AnnotatedExportBuilder export(Class<?> clazz) { return new AnnotatedExportBuilder(binder, Key.get(clazz)); }
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 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); } }
@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(); } }
/** * 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"); } }
@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 AnnotatedExportBuilder export(Class<?> clazz) { return new AnnotatedExportBuilder(binder, Key.get(clazz)); }
public AnnotatedExportBuilder export(Class<?> clazz) { return new AnnotatedExportBuilder(binder, Key.get(clazz)); }