Interface ModuleKeyFactory

All Superinterfaces:
AutoCloseable

public interface ModuleKeyFactory extends AutoCloseable
A factory for ModuleKeys.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Closes this factory, releasing any resources held.
    create(URI uri)
    Returns a ModuleKey for the given absolute normalized URI, or Optional.empty() if this factory cannot handle the given URI.
  • Method Details

    • create

      Returns a ModuleKey for the given absolute normalized URI, or Optional.empty() if this factory cannot handle the given URI.

      Implementations must not perform any I/O related to the given URI. For example, they must not check if the module represented by the given URI exists. SecurityManager checks for the returned module will be performed by clients of this method.

      Throws URISyntaxException if the given URI has invalid syntax.

      Parameters:
      uri - an absolute normalized URI
      Returns:
      a module key for the given URI
      Throws:
      URISyntaxException
    • close

      default void close()
      Closes this factory, releasing any resources held. See the documentation of factory methods in ModuleKeyFactories for which factories need to be closed.
      Specified by:
      close in interface AutoCloseable