Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-27 Thread Matej Novotny
...@univ-mlv.fr, "Matej Novotny" > Cc: jigsaw-dev@openjdk.java.net, "Tomas Remes" , "Martin > Kouba" > Sent: Wednesday, April 26, 2017 5:40:09 PM > Subject: Re: setAccessible() alternative with Jigsaw - feedback on Lookup > > On 26/04/2017 16:31, fo...@

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-27 Thread Alan Bateman
On 26/04/2017 15:04, Matej Novotny wrote: You can spin one module per package, by creating one ModuleLayer per package, not unlike j.l.r.Proxy does. Don't know a bit about it, but it sounds like a way worth exploring. Would you have a pointer towards some code showing how to deal with ModuleLa

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-26 Thread Alan Bateman
On 26/04/2017 16:31, fo...@univ-mlv.fr wrote: : 4. create a classloader ClassLoader classLoader = new ClassLoader(parentClassLoader()) { /* make defineClass more visible */}; 5. create your own layer [4] ModuleLayer layer = boot.defineModulesWithOneLoader(cf, classloader; 6

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-26 Thread forax
- Mail original - > De: "Matej Novotny" > À: "Remi Forax" > Cc: "Alan Bateman" , jigsaw-dev@openjdk.java.net, > "Tomas Remes" , "Martin > Kouba" > Envoyé: Mercredi 26 Avril 2017 16:04:08 > Objet: Re: setAccessi

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-26 Thread Andrew Dinn
On 26/04/17 15:04, Matej Novotny wrote: > >> You can spin one module per package, by creating one ModuleLayer per package, >> not unlike j.l.r.Proxy does. > > Don't know a bit about it, but it sounds like a way worth exploring. > Would you have a pointer towards some code showing how to deal with

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-26 Thread Matej Novotny
> You can spin one module per package, by creating one ModuleLayer per package, > not unlike j.l.r.Proxy does. Don't know a bit about it, but it sounds like a way worth exploring. Would you have a pointer towards some code showing how to deal with ModuleLayers? Also checking on j.l.r.Proxy, it

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-24 Thread Remi Forax
- Mail original - > De: "Matej Novotny" > Hi, > > thanks for your time. Comments inline. > [...] >> >> If you are looking to define a class in a new runtime package and the >> class loader that is not your implementation then you are out of luck. >> Lookup is designed for doing com

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-24 Thread Alan Bateman
On 24/04/2017 12:41, Matej Novotny wrote: : Not really sure, but it is certainly not one under our control. I suppose these "basic" classes will be loaded by, say, Wildfly as soon as you bootstrap it, before any CDI-enabled deployment takes place. The reason I picked out java.lang.Integer from

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-24 Thread Matej Novotny
Hi, thanks for your time. Comments inline. - Original Message - > From: "Alan Bateman" > To: "Matej Novotny" > Cc: jigsaw-dev@openjdk.java.net, "Martin Kouba" , "Tomas > Remes" > Sent: Thursday, April 20, 2017 10:52:04 AM

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-20 Thread Andrew Dinn
On 20/04/17 09:52, Alan Bateman wrote: > On 20/04/2017 07:43, Matej Novotny wrote: >> Another nasty thing is that the code of course needs to work with >> both, JDK 9 and 8. >> While it isn't impossible, it will add a not-so-nice reflection magic >> layer to the mix. >> > Multi-release JARs (JEP 23

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-20 Thread Alan Bateman
On 20/04/2017 07:43, Matej Novotny wrote: So I did some hacking and tried to make Weld use MethodHandles.Lookup and here is a bit of a feedback for you. But first of all, thanks for your quick advice on how to approach this. Thank you for writing down your experiences. So, how did Lookup w

Re: setAccessible() alternative with Jigsaw - feedback on Lookup

2017-04-19 Thread Matej Novotny
he mix. Regards Matej - Original Message - > From: "Alan Bateman" > To: "Matej Novotny" , jigsaw-dev@openjdk.java.net > Cc: "Martin Kouba" > Sent: Friday, March 31, 2017 4:28:34 PM > Subject: Re: setAccessible() alternative with Jigsaw > &g

Re: setAccessible() alternative with Jigsaw

2017-04-03 Thread Alan Bateman
On 03/04/2017 13:17, Matej Novotny wrote: Thanks for suggestion! I'll definitely look at that direction and see if it suffices. Good, and please report back your experiences. I could imagine you starting out using MethodHandles.privateLookupIn but it would be nice to get to the point where t

Re: setAccessible() alternative with Jigsaw

2017-04-03 Thread Matej Novotny
1, 2017 4:28:34 PM > Subject: Re: setAccessible() alternative with Jigsaw > > On 31/03/2017 14:46, Matej Novotny wrote: > > > Hello, > > > > I work on Weld, context dependency injection framework. > > Long story short - we need to generate prox

Re: setAccessible() alternative with Jigsaw

2017-03-31 Thread Thomas Matthijs
http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-March/011557.html On Fri, Mar 31, 2017 at 3:46 PM, Matej Novotny wrote: > Hello, > > I work on Weld, context dependency injection framework. > Long story short - we need to generate proxies for classes - bytecode which > we then "register" w

Re: setAccessible() alternative with Jigsaw

2017-03-31 Thread Alan Bateman
On 31/03/2017 14:46, Matej Novotny wrote: Hello, I work on Weld, context dependency injection framework. Long story short - we need to generate proxies for classes - bytecode which we then "register" with the class loader using java.lang.ClassLoader#defineClass. Obviously, for this you need r

Re: setAccessible() alternative with Jigsaw

2017-03-31 Thread Claes Redestad
Hi Matej, there's a recent addition in Lookup.defineClass which might fit your need, see: http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-March/011557.html Thanks! /Claes On 03/31/2017 03:46 PM, Matej Novotny wrote: Hello, I work on Weld, context dependency injection framework. Long

setAccessible() alternative with Jigsaw

2017-03-31 Thread Matej Novotny
Hello, I work on Weld, context dependency injection framework. Long story short - we need to generate proxies for classes - bytecode which we then "register" with the class loader using java.lang.ClassLoader#defineClass. Obviously, for this you need reflections - to load java.lang.ClassLoader, t