Interface ClassLoading

All Known Implementing Classes:
SimpleClassLoading

@Incubating public interface ClassLoading
Access to load resources from a ClassLoader
  • Method Details

    • classForName

      <T> Class<T> classForName(String name)
      Obtain a Class reference by name
      Parameters:
      name - The name of the class
      Returns:
      The Class object with the given name
      Throws:
      UnknownClassException - If no registration is found with the given name
    • findClassForName

      <T> Class<T> findClassForName(String name)
      Like classForName(String), except here we simply return null if there is not a matching class. This is often useful, e.g., when looking for a package-info.
    • locateResource

      URL locateResource(String resourceName)
      Locate a resource by name
      Parameters:
      resourceName - The name of the resource to resolve
      Returns:
      The located resource; may return null to indicate the resource was not found
    • loadJavaServices

      <S> Collection<S> loadJavaServices(Class<S> serviceType)
      Discovers and instantiates implementations of the given Java service contract.
      Type Parameters:
      S - The type of the service contract
      Parameters:
      serviceType - The java type defining the service contract
      Returns:
      The ordered set of discovered services.