Package dagger.producers.monitoring
Class ProductionComponentMonitor
java.lang.Object
dagger.producers.monitoring.ProductionComponentMonitor
- Direct Known Subclasses:
TimingProductionComponentMonitor
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ProductionComponentMonitornoOp()Returns a monitor that does no monitoring.abstract ProducerMonitorproducerMonitorFor(ProducerToken token) Returns a monitor for an individual producer method.
-
Constructor Details
-
ProductionComponentMonitor
public ProductionComponentMonitor()
-
-
Method Details
-
producerMonitorFor
Returns a monitor for an individual producer method. -
noOp
Returns a monitor that does no monitoring.
-