Module file parse API
Paul Sandoz
paul.sandoz at oracle.com
Mon Jun 18 06:50:59 PDT 2012
Hi Chris,
This is an excellent start. Looks good to me.
--
Some potential things we discussed off list for further commits:
- s/ModuleFileParser/ModuleFileReader. I can think of two alternative implementations; one that wraps a module installed into a library so the reader can be connected to a writer for extraction. Another that wraps a modular jar file so the same installer code can be reused, i am not sure exactly if that is possible but sounds nice in theory :-)
- IIRC the complete size of the jmod file is encoded in the file itself, thus after the file header has been read we can wrap everything around a CountingInputStream.
- An adapting implementation of ModuleFileReader which accumulates hashes (ignoring the hash for a section of the signature type) and validates hashes. It can be reused by the installer/extractor and the signer.
Paul.
On Jun 18, 2012, at 2:49 PM, Chris Hegarty wrote:
> Paul gave me some feedback off list. Updated the webrev, same location:
>
> > http://cr.openjdk.java.net/~chegar/jigsaw/moduleParser_webrev.00/webrev/
>
> * ModuleFileParserException is now a RuntimeException
> * Fixed up javadoc example code
> * Some minor bug fixes
> * Method naming consistency
>
> I see this as step one in a phased approach to the reader/writer API's. There is still work to be done to clean up the Reader ( now really an Installed/Extractor ), the *Header types, and obviously the writer.
>
> What I would like is get this first set of changes in ( if others agree with the API ), and then address the above outstanding issues with further commits.
>
> Thanks,
> -Chris.
>
> On 13/06/2012 11:42, Chris Hegarty wrote:
>> Hi,
>>
>> A while back it was suggested that it may be useful to define a pull
>> parser type API for reading from a module file. I gives separation of
>> the parsing of the module file from the writing of it (either installing
>> into the module library, or extraction elsewhere ).
>>
>> I've prototyped such an API and updated the ModuleFile.Reader to use it.
>> The first four files in the webrev contain the API, its implementation,
>> and a test that demonstrates some sample usage ( extraction of one or
>> more classes, listing sections, verifying hashes ). The remainder of the
>> changes simply updates some of the tools for installing and handling
>> signed modules.
>>
>> http://cr.openjdk.java.net/~chegar/jigsaw/moduleParser_webrev.00/webrev/
>>
>> Thanks,
>> -Chris.
More information about the jigsaw-dev
mailing list