Patch for audi/midi services <was> Re: Audio/Midi services <was> Fwd: CR 7172234 Created, P2 java/jigsaw Lot of sound test failed due UnsatisfiedLinkError for com.sun.media.sound.* classes

Paul Sandoz paul.sandoz at oracle.com
Wed May 30 09:04:38 PDT 2012


On May 30, 2012, at 5:52 PM, Alan Bateman wrote:

> On 30/05/2012 15:41, Paul Sandoz wrote:
>> :
>> 
>> It seems the pattern in jdk.depconfig is to always use optional, so i kept it like that, but since there are always services for the audi/midi cases, we don't need it to be optional, correct?
>> 
> Most (perhaps all) usages of ServiceLoader in the JDK also have a fallback to a default implementation when there aren't any service providers (service implementations) installed.  So assuming this is how it specified then then "requires optional service ..." is right.
> 

Without a deeper look at the code and JavaDoc i cannot completely tell. So optional seems like the right choice for now.


> I'm not familiar with the JavaSound API. If the specification requires that there be at least one service provider then the module declaration should be "requires service ..." and the resolver will fail with " No implementations of service .." if there aren't any implementations. As we don't have the module-info source files checked in then it means @Provider in the jdk.depconfig file. I don't think we have any cases like that yet but it will require the META-INF/services to be present in order for the class analyzer to generate the "provides service ..." in the module declaration.
> 

Yes, all the midi/sound requires/provides in the desktop module are generated as i would expect.

Paul.


More information about the jigsaw-dev mailing list