public static < T > T loadAnyServiceProvider ( Class < T > klass ) { T provider = findAnyServiceProvider ( klass ) ; if ( provider == null ) { throw new NoServiceProviderException ( klass . getName ( ) + ": no service provider found in META-INF/services on classpath" ) ; } return provider ; }
Returns any provider for a given service and throws an exception when no provider is found on the classpath .