java.util.ServiceLoader.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中java.util.ServiceLoader.<init>()方法的一些代码示例,展示了ServiceLoader.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ServiceLoader.<init>()方法的具体详情如下:
包路径:java.util.ServiceLoader
类名称:ServiceLoader
方法名:<init>

ServiceLoader.<init>介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Constructs a service loader. If {@code classLoader} is null, the system class loader
 * is used.
 *
 * @param service the service class or interface
 * @param classLoader the class loader
 * @return a new ServiceLoader
 */
public static <S> ServiceLoader<S> load(Class<S> service, ClassLoader classLoader) {
  if (classLoader == null) {
    classLoader = ClassLoader.getSystemClassLoader();
  }
  return new ServiceLoader<S>(service, classLoader);
}

代码示例来源:origin: com.jtransc/jtransc-rt

public static <S> ServiceLoader<S> load(Class<S> service) {
  //return ServiceLoader.load(service, Thread.currentThread().getContextClassLoader());
  //if (classLoader == null) classLoader = ClassLoader.getSystemClassLoader();
  return new ServiceLoader<S>(service);
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Creates a new service loader for the given service type and class
 * loader.
 *
 * @param  service
 *         The interface or abstract class representing the service
 *
 * @param  loader
 *         The class loader to be used to load provider-configuration files
 *         and provider classes, or <tt>null</tt> if the system class
 *         loader (or, failing that, the bootstrap class loader) is to be
 *         used
 *
 * @return A new service loader
 */
public static <S> ServiceLoader<S> load(Class<S> service,
                    ClassLoader loader)
{
  return new ServiceLoader<>(service, loader);
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul.mini

/**
 * Creates a new service loader for the given service type and class
 * loader.
 *
 * @param  service
 *         The interface or abstract class representing the service
 *
 * @param  loader
 *         The class loader to be used to load provider-configuration files
 *         and provider classes, or <tt>null</tt> if the system class
 *         loader (or, failing that, the bootstrap class loader) is to be
 *         used
 *
 * @return A new service loader
 */
public static <S> ServiceLoader<S> load(Class<S> service,
                    ClassLoader loader)
{
  return new ServiceLoader<>(service, loader);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Constructs a service loader. If {@code classLoader} is null, the system class loader
 * is used.
 *
 * @param service the service class or interface
 * @param classLoader the class loader
 * @return a new ServiceLoader
 */
public static <S> ServiceLoader<S> load(Class<S> service, ClassLoader classLoader) {
  if (classLoader == null) {
    classLoader = ClassLoader.getSystemClassLoader();
  }
  return new ServiceLoader<S>(service, classLoader);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Constructs a service loader. If {@code classLoader} is null, the system class loader
 * is used.
 *
 * @param service the service class or interface
 * @param classLoader the class loader
 * @return a new ServiceLoader
 */
public static <S> ServiceLoader<S> load(Class<S> service, ClassLoader classLoader) {
  if (classLoader == null) {
    classLoader = ClassLoader.getSystemClassLoader();
  }
  return new ServiceLoader<S>(service, classLoader);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Constructs a service loader. If {@code classLoader} is null, the system class loader
 * is used.
 *
 * @param service the service class or interface
 * @param classLoader the class loader
 * @return a new ServiceLoader
 */
public static <S> ServiceLoader<S> load(Class<S> service, ClassLoader classLoader) {
  if (classLoader == null) {
    classLoader = ClassLoader.getSystemClassLoader();
  }
  return new ServiceLoader<S>(service, classLoader);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Constructs a service loader. If {@code classLoader} is null, the system class loader
 * is used.
 *
 * @param service the service class or interface
 * @param classLoader the class loader
 * @return a new ServiceLoader
 */
public static <S> ServiceLoader<S> load(Class<S> service, ClassLoader classLoader) {
  if (classLoader == null) {
    classLoader = ClassLoader.getSystemClassLoader();
  }
  return new ServiceLoader<S>(service, classLoader);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Constructs a service loader. If {@code classLoader} is null, the system class loader
 * is used.
 *
 * @param service the service class or interface
 * @param classLoader the class loader
 * @return a new ServiceLoader
 */
public static <S> ServiceLoader<S> load(Class<S> service, ClassLoader classLoader) {
  if (classLoader == null) {
    classLoader = ClassLoader.getSystemClassLoader();
  }
  return new ServiceLoader<S>(service, classLoader);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Constructs a service loader. If {@code classLoader} is null, the system class loader
 * is used.
 *
 * @param service the service class or interface
 * @param classLoader the class loader
 * @return a new ServiceLoader
 */
public static <S> ServiceLoader<S> load(Class<S> service, ClassLoader classLoader) {
  if (classLoader == null) {
    classLoader = ClassLoader.getSystemClassLoader();
  }
  return new ServiceLoader<S>(service, classLoader);
}

相关文章