Class ProductionComponentMonitor

  • Direct Known Subclasses:

    public abstract class ProductionComponentMonitor
    extends java.lang.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:

       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.