Class ModuleLocation

java.lang.Object
org.eclipse.jetty.util.ModuleLocation
All Implemented Interfaces:
Function<Class<?>,URI>

class ModuleLocation extends Object implements Function<Class<?>,URI>
Equivalent of ...
 Module module = clazz.getModule();
 if (module != null)
 {
     Configuration configuration = module.getLayer().configuration();
     Optional resolvedModule = configuration.findModule(module.getName());
     if (resolvedModule.isPresent())
     {
         ModuleReference moduleReference = resolvedModule.get().reference();
         Optional location = moduleReference.location();
         if (location.isPresent())
         {
             return location.get();
         }
     }
 }
 return null;
 
In Jetty 10, this entire class can be moved to direct calls to java.lang.Module in TypeUtil.getModuleLocation()
  • Field Details

    • LOG

      private static final Logger LOG
    • classModule

      private final Class<?> classModule
    • handleGetModule

      private final MethodHandle handleGetModule
    • handleGetLayer

      private final MethodHandle handleGetLayer
    • handleConfiguration

      private final MethodHandle handleConfiguration
    • handleGetName

      private final MethodHandle handleGetName
    • handleOptionalResolvedModule

      private final MethodHandle handleOptionalResolvedModule
    • handleReference

      private final MethodHandle handleReference
    • handleLocation

      private final MethodHandle handleLocation
  • Constructor Details

    • ModuleLocation

      public ModuleLocation()
  • Method Details