コード例 #1
0
ファイル: Apis.java プロジェクト: syeduguri/openstack4j
 private static APIProvider initializeProvider() {
   // No need to check for emptiness as there is default implementation registered
   APIProvider p =
       ServiceLoader.load(APIProvider.class, Apis.class.getClassLoader()).iterator().next();
   p.initialize();
   return p;
 }
コード例 #2
0
ファイル: Apis.java プロジェクト: syeduguri/openstack4j
 /**
  * Gets the API implementation based on Type
  *
  * @param <T> the API type
  * @param api the API implementation
  * @return the API implementation
  */
 public static <T> T get(Class<T> api) {
   return provider.get(api);
 }