JDK support for VM to read classes from modules in a module library

Jesse Glick jesse.glick at oracle.com
Wed May 16 14:48:13 PDT 2012


On 05/16/2012 04:39 PM, Mandy Chung wrote:
> JAXP provided by other vendor would not provide the XMLUtils service unless it's part of the specification.

No need to touch JAXP itself:

module jdk.base {
   ...
   view sun.jaxp.bridge {
     permits sun.jaxp.bridge.impl; // <--
     exports sun.misc;
   }
   requires optional service sun.misc.XMLUtils;
}
// jdk.base classes as in first message
module jdk.jaxp {
   // unmodified
}
module sun.jaxp.bridge.impl {
   requires jdk.jaxp; // or its vendor substitute
   requires sun.jaxp.bridge;
   provides service sun.misc.XMLUtils with sun.misc.XMLUtilsImpl;
}
package sun.misc;
public class XMLUtilsImpl implements XMLUtils {
   // call javax.xml.** methods
}

As Yarda's message pointed out, the same bridge module could deal with XML-format Preferences, and you could supply a fallback implementation based on something like 
NanoXML for use in small environments where JAXP would be overkill.



More information about the jigsaw-dev mailing list