----- Mail original ----- > De: "Andrew Dinn" <ad...@redhat.com> > À: "Remi Forax" <fo...@univ-mlv.fr> > Cc: "mark reinhold" <mark.reinh...@oracle.com>, jigsaw-dev@openjdk.java.net, > jpms-spec-comme...@openjdk.java.net > Envoyé: Mardi 5 Juillet 2016 11:18:04 > Objet: Re: Proposals for some open JPMS issues, > #ReflectiveAccessByInstrumentationAgents > > Hi Remi, > > On 05/07/16 00:00, Remi Forax wrote: > > Hi Andrew, for me it's another issue, > > currently you can not use a modular jar with the -javaagent on the command > > line, > > it's seems to be the root cause of your issue. > > Yes, that's basically it. Although, I'll admit I'm not really keen on > making my agent modular. However, if the agent jar was modular then the > current proposal would be workable. > > > Now, the workaround, > > there are two ways to create a module, one is to have a modular jar in the > > modulepath, > > the other is to create a Layer to dynamically creates a module at runtime. > > So currently, you can have the main instrumentation class in a default > > module, > > this class can dynamically creates your module M', and add an export fom M' > > to M > > each time you need to rewrite a class of a module M. > > I mentioned in my previous post that the first option is at best awkward > (in the command line use case) and, worse, is not going to be of help > when the agent is loaded dynamically (which is the normal usage for my > agent). > > Can you explain in more detail [or, better, point me at the docs which > show] how I can create a module at runtime? I did not think that was > possible. I think that would be by far the best option for me and it > would also make the current proposal acceptable.
sure, the doc of j.l.r.Layer should be enough: http://download.java.net/java/jdk9/docs/api/java/lang/reflect/Layer.html > > regards, regards, Rémi > > > Andrew Dinn > ----------- > Senior Principal Software Engineer > Red Hat UK Ltd > Registered in England and Wales under Company Registration No. 03798903 > Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander >