Multiple Versions at Launch-Time

Nicolai Parlog nipa at codefx.org
Tue Oct 20 17:10:02 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

 Hi Alan,

thanks for taking the time to respond.

> Assuming it's not "requires public LibA" then I would expect you 
> should be able to create a Configuration.
I am able to create a java.lang.module.Configuration[1] at runtime
that uses different layers and class loaders and hence works nicely.
In this case I don't even have to mangle any module names or
dependencies - it is straight forward to load different versions of
the same module.

But this is runtime behavior akin to what containers do, right? It
would be great if this could be achieved without extra code, just via
command line, so it is open for any run of the mill Java project
without extra complexity and dependencies.

> It will fail of course if you attempt to instantiate that 
> configuration with both LibB_v1 and LibB_v2 mapped to the same
> class loader and maybe that is what you are running into.
Is there any way to create a more complex configuration via command
line that uses more than the application class loader for user space
modules?

 so long ... Nicolai


[1] Someone suggested renaming it to 'LayerConfiguration' - I think
that's a great idea.



On 20.10.2015 15:53, Alan Bateman wrote:
> 
> On 20/10/2015 14:30, Nicolai Parlog wrote:
>> :
>> 
>> One way I hoped to do this was to treat both versions as two
>> different modules, i.e. renaming them and update the dependencies
>> on them.
>> 
>> App requires LibA App requires LibB_v2 LibA requires LibB_v1
>> 
>> This does not work because both modules would export the same 
>> packages. That's a little disappointing - I hoped it wouldn't
>> matter because no module is reading from both versions.
>> 
> Assuming it's not "requires public LibA" then I would expect you
> should be able to create a Configuration. It will fail of course if
> you attempt to instantiate that configuration with both LibB_v1 and
> LibB_v2 mapped to the same class loader and maybe that is what you
> are running into.
> 
> -Alan.
> 

- -- 

PGP Key:
    http://keys.gnupg.net/pks/lookup?op=vindex&search=0xCA3BAD2E9CCCD509

Web:
    http://codefx.org
        a blog about software development
    http://do-foss.de
        Free and Open Source Software for the City of Dortmund

Twitter:
    https://twitter.com/nipafx

Diaspora:
    nipa at pod.geraspora.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWJnVpAAoJEMo7rS6czNUJ9ogQAL7UbTV38qbFkl0xGMwWon7y
YRLtYG0BrhM+Prpytb4cjt1p5rU5AWrtk7ZUA9K/fT0r1AtpHhbVGzwx2v+djM6a
Z4KT21k6/0GZaK51paZr1lwtUTt/n9crzSt0DTr59VI4YDNC4s2iNfZ42AblXRBe
XFuFip/jScH4kojSs4XKQiUaDZhAlbUwYjFFQoTE6TKWCu0qIeDGXxquYp0n1b9a
Z/bV3dMxcxx+4Ysjgyxjilwfw7uJiPZS3ABfKs31AjrYxZTABTvfSvmsRYDk/D0z
NXCBHjTd9VFNIYwbOHTdTja2OK2fl6BWJOrFCJQOqv1Iw5PDH+nou7Q160rH0QOx
IoXZiXBT5keRWf8y0wJpXuoYtTk1yA61Q34fjpNNnFlZIB/6J0AQw/uYqs36wM6V
ok8OYefJs5mAo9iHKPwQ7Sr+jMBJ5lloI8bRacyzhfRlA6rDOg4C0jP+TkC+1S84
n6U7RkIlw+PaqYzSVCwBXPCLxNkhbfOo0CjAIUpMdRdcyYcAgrovL70sgnRaKgps
Bx1l7756OHFdWpDuHdluiJThMEW2wb7De1zh737Ms5/FjFb4bNgMz/uQrUypPU6s
jYS5l3mdeOggm6VCzFKrgf4iSojDREVX/pUj5164jlMlCxRTNcSpLmfmqd0Iwena
bgsZWZG4VmmL3+IUMZ0A
=mBHf
-----END PGP SIGNATURE-----



More information about the jigsaw-dev mailing list