Whitelisting modules in layers
Mark Raynsford
org.openjdk at io7m.com
Sat Dec 2 11:13:25 UTC 2017
On 2017-12-02T09:32:37 +0000
Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> It looks like this demo is attempting to create a module layer from a
> configuration that contains java.base. The java.base module is in the
> boot layer, alternative implementations of java.base are not allowed in
> other layers (java.base is special in this regard and the
> defineModulesXXX methods are all specified to throw
> LayerInstaniationException if the configuration contains java.base).
Right, got it. I thought I was creating a layer that delegated to the
boot layer for java.base, but obviously not.
> On your question then the module layer API doesn't provide a way to
> "hide" modules in the parent layers. You can override any module (except
> java.base) with an alternative implementation in the child layer but it
> doesn't provide anyway to hide modules that you aren't overriding.
OK, thanks!
It occurs to me that I'm essentially trying to do the work that the
SecurityManager would have done in the past: Restrict access to
packages (or in this case, entire modules).
--
Mark Raynsford | http://www.io7m.com
More information about the jigsaw-dev
mailing list