Interface ServiceProviderInstantiator


An instantiator of ServiceLoader.Provider instances.
Author:
Laird Nelson
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> T
    instantiate(ServiceLoader.Provider<? extends T> serviceLoaderProvider)
    Instantiates the supplied ServiceLoader.Provider and returns the resulting service provider.
  • Method Details

    • instantiate

      default <T> T instantiate(ServiceLoader.Provider<? extends T> serviceLoaderProvider)
      Instantiates the supplied ServiceLoader.Provider and returns the resulting service provider.
      Type Parameters:
      T - the type of service provider to instantiate
      Parameters:
      serviceLoaderProvider - a ServiceLoader.Provider; must not be null
      Returns:
      a service provider; never null
      Throws:
      NullPointerException - if serviceLoaderProvider is null
      Idempotency:
      The idempotency and determinism of any implementation of this method is left undefined.
      Nullability:
      This method does not, and its overrides must not, return null.
      Thread Safety:
      This method and any override is not guaranteed to be safe for concurrent use by multiple threads.