public static < T > List < T > load ( final Class < T > type , final ClassLoader classLoader ) { final List < T > loaded = new ArrayList <> ( ) ; final Iterator < T > iterator = ServiceLoader . load ( type , classLoader ) . iterator ( ) ; while ( hasNextSafely ( iterator ) ) { try { final T next = iterator . next ( ) ; loaded . add ( next ) ; LOGGER . debug ( "Found {}" , type ) ; } catch ( Exception e ) { LOGGER . error ( "Could not load {}: {}" , type , e ) ; } } return loaded ; }
Load implementation by given type .