Interface ModuleAgent


public interface ModuleAgent
Interface for a class that brokers a class loader instance which is capable of loading public classes.

Usage: specialistsBroker.requireSpecialist(ModuleAgent.TYPE).getClassLoader().

Since:
4.2.404
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Specialist providing means to load public classes.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull ClassLoader
    Returns a class loader instance which is capable of loading all global module classes.
    Returns all components which implements or extends the given type.
    <T> @Nullable Class<? extends T>
    getTypeForName(String name, Class<T> type)
    Returns the exported class that matches the given interface type and name.
  • Field Details

  • Method Details

    • getClassLoader

      @NotNull @NotNull ClassLoader getClassLoader()
      Returns a class loader instance which is capable of loading all global module classes.
      Returns:
      A class loader instance which is capable of loading all global module classes.
      Since:
      4.2.404
    • getComponents

      @NotNull @NotNull Collection<ComponentDescriptor> getComponents(Class<?> type)
      Returns all components which implements or extends the given type.
      Parameters:
      type - The requested type.
      Returns:
      A collection of matching descriptors.
      Since:
      4.2.404
    • getTypeForName

      @Nullable <T> @Nullable Class<? extends T> getTypeForName(String name, Class<T> type)
      Returns the exported class that matches the given interface type and name. Returns null if no match is found.
      Parameters:
      name - name to match
      type - interface to match
      Returns:
      The exported class matching the given parameters or null if there is no matching exported class
      Throws:
      IllegalStateException - if loading of the exported class fails.
      Since:
      4.2.404