org.ungoverned.moduleloader.search
Interface SelectionPolicy

All Known Implementing Classes:
InteractiveSelectionPolicy, OSGiSelectionPolicy, SimpleSelectionPolicy

public interface SelectionPolicy

This interface represents the policy for selecting a specific export target from multiple compatible candidate export targets when the ImportSearchPolicy is trying to resolve an import target for a given module. A concrete implementation of this interface is required to create an instance of ImportSearchPolicy.

See Also:
ImportSearchPolicy

Method Summary
 Module select(Module module, java.lang.Object identifier, java.lang.Object version, Module[] candidates, CompatibilityPolicy compatPolicy)
          Selects a single module to resolve the specified import from the array of compatible candidate modules.
 

Method Detail

select

Module select(Module module,
              java.lang.Object identifier,
              java.lang.Object version,
              Module[] candidates,
              CompatibilityPolicy compatPolicy)
Selects a single module to resolve the specified import from the array of compatible candidate modules.

Parameters:
module - the module that is importing the target.
identifier - the identifier of the import target.
version - the version number of the import target.
candidates - array of compatible candidate modules from which to choose.
compatPolicy - the compatibility policy that is being used.
Returns:
the selected module or null if no module can be selected.