Class ProductionComponentMonitor

java.lang.Object
dagger.producers.monitoring.ProductionComponentMonitor
Direct Known Subclasses:
TimingProductionComponentMonitor

public abstract class ProductionComponentMonitor extends Object
A hook for monitoring execution of production components. To install a ProductionComponentMonitor, contribute to a set binding of ProductionComponentMonitor.Factory. The factory will be asked to create one monitor for the component, and the resulting single instance will be used to create individual monitors for producers.

For example:


   @Module
   final class MyMonitorModule {
     @Provides @IntoSet ProductionComponentMonitor.Factory provideMonitorFactory(
         MyProductionComponentMonitor.Factory monitorFactory) {
       return monitorFactory;
     }
   }

   @ProductionComponent(modules = {MyMonitorModule.class, MyProducerModule.class})
   interface MyComponent {
     ListenableFuture<SomeType> someType();
   }
 

If any of these methods throw, then the exception will be logged, and the framework will act as though a no-op monitor was returned.

Since:
2.1
  • Constructor Details

    • ProductionComponentMonitor

      public ProductionComponentMonitor()
  • Method Details