Jigsaw spec clarifications

Alan Bateman Alan.Bateman at oracle.com
Fri Jan 20 04:28:01 PST 2012


On 20/01/2012 00:30, Alex Buckley wrote:
> :
>
> I hope Alan can confirm my understanding of services as follows:
>
> On 1/19/2012 2:33 PM, Jonathan Gibbons wrote:
>> provides service S with S_A;
>> provides service S with S_B;
>
> Illegal. Ambiguity in which implementation to use.
I read your subsequent clarification and I agree it has to be legal (and 
we have a test for this in the current services patch [1]).


>
>> provides service S1 with S;
>> provides service S2 with S;
>
> Legal.
Yes, but probably won't be too common (either S is an interface, or S1 
or S2 is a subtype of the other).

As to one of Jesse's points, I don't think the current spec mandates 
that the the service implementation have a public no-arg constructor. 
javac doesn't check for this currently so it's possible to get a 
ServiceConfigurationError at runtime for this case with the current 
patch. An entry point on the other is specified to have a public static 
void main method.

-Alan.

[1] http://cr.openjdk.java.net/~alanb/jigsaw-services/webrev/



More information about the jigsaw-dev mailing list