[modules-dev] Issue re location of extension & user repositories

Dave Bristor David.Bristor at Sun.COM
Tue Jul 24 14:52:48 PDT 2007


Hi folks,

In yesterday's meeting we decided that the default configuration should 
support a set of repositories like this:

bootstrap
   ^
   |
jre extension
   ^
   |
system extension
   ^
   |
global
   ^
   |
user
   ^
   |
system

We agreed on the location of the extension repositories:

jre extension ${java.home}/lib/module/ext
system extension ???/lib/module/ext

If we base the location of the latter on what is standard for system 
extensions, we have a slight problem, in that the location varies across 
platforms:
%SystemRoot%\Sun\Java\lib\ext           [Microsoft Windows]
/usr/java/packages/lib/ext              [Linux]
/usr/jdk/packages/lib/ext               [Solaris OS]

(From http://java.sun.com/javase/6/docs/technotes/guides/extensions/spec.html)

We have a similar situation with the user repository: on my solaris box the 
logical place would be $HOME/.java (linux too, presumably) but on Windows it 
is %SystemRoot%\$USER\Application Data\Sun\Java.

The current mechanism of configuring repositories allows for at most 
specifying the class of repository to be used in a particular case.  One 
solution is to use a set of locations that have more in common than the above. 
  Another is to introduce a factory into the configuration, which can choose 
the location.  For that case, I propose we allow for a FACTORY attribute, e.g.

systemextension.FACTORY=sun.module.repository.ExtensionRepositoryFactory

Such a factory class would be required to have a no-arg constructor, and a 
factory method
     Repository createRepository(Map<String, String>)

At system startup, when FACTORY is specified, we'll create an instance and 
invoke createRepository on it, passing all properties given in the config file 
ror that repository.

It would be an error for the config file to specify both FACTORY and CLASS 
properties for a given repository.

In the particular cases of system extension and user repositories, there would 
be no need to specify their locations in the config file, as the factory would 
determine the location.

I think this work can be done as an add-on to the work done thus far...I'd 
rather not have this delay the work-to-date (any more review feedback?) but 
either way is fine.

Thanks,
	Dave



More information about the modules-dev mailing list