Discussion: #MutableConfigurations, #LazyConfigurationAndInstantiation, #CyclicDependences, & #DiscardableModules

mark.reinhold at oracle.com mark.reinhold at oracle.com
Wed Nov 30 00:09:02 UTC 2016


2016/11/22 13:19:19 -0800, david.lloyd at redhat.com:
> On 11/21/2016 03:52 PM, mark.reinhold at oracle.com wrote:
>> ...
>> 
>> If you're using an approach similar to what I suggested for OSGi [1]
>> then you should be able to implement cycles amongst JBoss modules by
>> inserting the necessary readability edges after each module is
>> instantiated in its own layer.  This will be much easier with the new
>> API proposed for #ReadabilityAddedByLayerCreator [2].
> 
> I asked earlier whether this allows the class resolver

(What's a "class resolver" in this context?)

>                                                        to resolve 
> against modules with a lately-added readability edge as you describe 
> here, and it sounded like the answer was "no"; did I miss something?

No, I don't think so.  Readability edges added at run time only affect
run-time access-control checks; they don't affect later module-resolution
operations.

>                                                                       If 
> my understanding was right, then this doesn't allow for circularity at 
> the class level where we need it.

The JPMS resolver does not allow cycles amongst modules; this has long
been the case.  (Circularity amongst classes is allowed, as it must be.)

If you want to allow cycles amongst your own modules then you can resolve
them yourself and add whatever cycle-inducing readability edges you need.
That is, as I understand it, how Watson's OSGi embedding works.

- Mark


More information about the jpms-spec-experts mailing list