Module-system requirements

mark.reinhold at oracle.com mark.reinhold at oracle.com
Mon Mar 16 20:45:06 UTC 2015


2015/3/11 7:30 -0700, Remi Forax <forax at univ-mlv.fr>:
> On 03/11/2015 02:23 PM, David M. Lloyd wrote:
>> On 03/09/2015 03:56 PM, mark.reinhold at oracle.com wrote:
>>> Either way, this use case suggests a new requirement for the Development
>>> section:
>>> 
>>> - _Annotation digests_ --- When packaging a module into an artifact
>>> it must be possible to augment its definition with a summary of all
>>> of the type- and package-level annotations that are present in the
>>> module, together with an indication of the types and packages to
>>> which each annotation applies.  This digest must be easily readable
>>> from module artifacts, and at run time those parts of it related to
>>> annotations retained for run time must be available through an
>>> appropriate reflective API.
>>> 
>>> Comments?
>> 
>> If we're looking to extend this into the domain of Java EE annotations 
>> (for example), we'd also have to add method and field annotations to 
>> the list.  And SE 8 type annotations might add some strange color to 
>> this as well.
> 
> Why do that when packaging a module and not when you install a module ?

Packaging a module is, generally, not a time-sensitive operation, while
configuring and loading a module often is.  Doing more work while
packaging in order to do less work at run time (or even compile time)
is a pretty nice tradeoff to be able to make.

> I really think we need a way to do some actions when modules are installed
> (and before being transformed on an image),
> either some global action on all modules like crawling for annotations
> or on the module that contains the code that does the action
> (or maybe both).

The requirements don't imply or presuppose a notion of "installation",
other than the installation of OS-specific packages (e.g., RPMs) that
contain Java modules.  Modules can be loaded at or after startup, or
linked into a static image, but there's no notion of "installation"
as such.

A sophisticated, module-managing application could certainly pre-process
modules in some way before it loads them, if needed, but I think that's
outside the scope of the module system.

- Mark


More information about the jpms-spec-observers mailing list