Module file parse API
Chris Hegarty
chris.hegarty at oracle.com
Wed Jun 20 09:49:55 PDT 2012
On 20/06/2012 17:28, Sean Mullan wrote:
> Hi Chris,
>
> I've just been reviewing the changes to Signer.java. With the new code,
> it looks like the caller is now responsible for verifying the hashes
> whereas in the old code, the Reader would automatically take care of it
> for you. Can you explain why you changed that?
The parser is just that, a parser. It generates the hashes of section
data and exposes the section headers hashes, giving flexibility to the
caller on how to handle them ( you may decide to have a non validating
implementation! ). The previous way of doing this was just a hack that
preventing the Reader from actually writing any data, 'extract = false',
when the reader is actually an installer.
Now that Signer can invoke the parser directly rather than creating a
Reader/Installer we can actually simplify the Reader/Installer so that
it always extracts the content. I found this to be a more flexible and
cleaner solution.
Sorry if I've missed the point of your question. Was this what you were
asking?
-Chris.
>
> Thanks,
> Sean
>
> On 06/13/2012 06:42 AM, 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