public static < T > List < T > findServiceProviders ( Class < T > klass ) { ServiceLoader < T > loader = ServiceLoader . load ( klass ) ; List < T > providers = new ArrayList < T > ( ) ; Iterator < T > it = loader . iterator ( ) ; while ( it . hasNext ( ) ) { providers . add ( it . next ( ) ) ; } return providers ; }
Finds all providers for a given service .