java.module
Interface ImportOverridePolicy


public interface ImportOverridePolicy

This interface represents the import override policy which is a mechanism that allows deployers to narrow the version constraints in the import dependencies of a specific module definition to control the resolution.

The import override policy is invoked before the default or custom import policy of the module instance is executed during initialization.

Since:
1.7.0
Author:
Stanley M. Ho
See Also:
ImportPolicy, ModuleDefinition, VersionConstraint

Method Summary
 Map<String,VersionConstraint> narrow(ModuleDefinition importer, Map<String,VersionConstraint> constraints)
          Returns a map of imported module names and overridden version constraints for the module definition.
 

Method Detail

narrow

Map<String,VersionConstraint> narrow(ModuleDefinition importer,
                                     Map<String,VersionConstraint> constraints)
Returns a map of imported module names and overridden version constraints for the module definition. The returned map contains the same set of module names as the given map.

For each import dependency, the overridden version constraint must be within the boundary of the original version constraint that was specified in the module definition at build time. Otherwise module initialization will fail.

Parameters:
importer - the importing module definition.
constraints - an unmodifiable map of imported module names and overridden version constraints.
Returns:
the map of imported module names and overridden version constraints. It contains the same set of module names as the given map.