public MetricsFactory resolve ( ) { for ( MetricsFactoryService metricsFactoryService : serviceLoader ) { MetricsFactory metricsFactory = metricsFactoryService . load ( ) ; if ( metricsFactory != null ) { return metricsFactory ; } } throw new IllegalStateException ( "No MetricsFactory could be loaded!" ) ; }
Resolve MetricsFactory from the Service Provider Interface configuration