public abstract class ProductionComponentMonitor extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
ProductionComponentMonitor.Factory |
Constructor and Description |
---|
ProductionComponentMonitor() |
Modifier and Type | Method and Description |
---|---|
static ProductionComponentMonitor |
noOp()
Returns a monitor that does no monitoring.
|
abstract ProducerMonitor |
producerMonitorFor(ProducerToken token)
Returns a monitor for an individual producer method.
|
public abstract ProducerMonitor producerMonitorFor(ProducerToken token)
public static ProductionComponentMonitor noOp()
Copyright © 2012���2017 The Dagger Authors. All rights reserved.