[modules-dev] Review request: 6560281

Stanley M. Ho Stanley.Ho at Sun.COM
Thu Jul 19 20:03:30 PDT 2007


Hi Dave,

Dave Bristor wrote:
> Why must the source location be a URL?  In repository.properties it 
> given as a file.

Source location could be either a URL or file path. However, the 
repository.properties in the shipping JRE will be the same for all 
platforms. Because file path is platform specific, the default source 
locations come with the repository.properties in the JRE would be in the 
form of URL.

> CLASS could be sun.module.repository.LocalRepository.
> 
> Or, we could check the URL: if it's a file: URL, create a LocalRepository.

This would exclude the case where you want to use URLRepository with a 
file URL. In fact, this is what we might end up using for the extension 
repository.

> In the process of running tests, I found a failure, fixed it, but wonder 
> about a couple things.  Take a look at the changes to ModuleLauncher.  
> It seems odd to me that we don't have a method Query.version(Version).  
> Is that intentional?

Yes. Try Query.version(Version.toVersionConstraint()).

> Second, repository.install returns a ModuleArchiveInfo, but we need a 
> ModuleDefinition, so we find() it.  Would it make sense for a method
>     ModuleDefinition Repository.get(ModuleArchiveInfo)
> based on the identity of the ModuleArchiveInfo?

No. Installing a jam file does not mean you could always use its 
ModuleDefinition at runtime, e.g. the ModuleDefinition might be shadowed 
by another ModuleDefinition with the same name and version in a parent 
repository. Try Repository.find(mainfo.getName(), mainfo.getVersion()).

- Stanley



More information about the modules-dev mailing list