[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: [9] review request: 8131888: Deliver javafx.swt as a modular jar in JDK 9
From:       Mandy Chung <mandy.chung () oracle ! com>
Date:       2016-05-27 16:58:59
Message-ID: E4A7A52C-2D5F-4267-98F5-B8FF90AF4948 () oracle ! com
[Download RAW message or body]


> On May 27, 2016, at 1:30 AM, Tom Schindl <tom.schindl@bestsolution.at> wrote:
> 
> Do you have an example how to construct such a Layer?


// path is the path to javafx-swt.jar
ModuleFinder finder = ModuleFinder.of(path);
Configuration cf = Layer.boot()
    .configuration()
    .resolveRequires(finder, ModuleFinder.of(), Set.of("javafx.swt"));

// "parent" is the class loader to which SWT types are visible
Layer layer = Layer.boot().defineModulesWithOneLoader(cf, parent);

// the class loader defining javafx.swt module
ClassLoader loader = layer.findLoader("javafx.swt");

[1] will show more examples of Layer.
Mandy
[1] http://hg.openjdk.java.net/jdk9/dev/jdk/file/df35a805b405/test/java/lang/reflect/Layer/LayerAndLoadersTest.java



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic