Proposal for fixing issues 20 and 21

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 16 Nov 2007 16:41:42 -0500


Issues 20 and 21[1,2] concern the use of Sun classes in the API. We'd
like to remove the need for these classes as outlined in the sketch at:

In the above we replace ProviderFactory and HeaderProvider with the
new RuntimeDelegate class. A JAX-RS implementation will be required to
provide a concrete subclass of RuntimeDelegate that implements certain
functionality required elsewhere in the API (the abstract methods of
RuntimeDelegate). The actual RuntimeDelegate implementation class is
configured in one of a variety of different ways as spelled out by the
Javadoc, see:

Those of you familiar with JAX-WS will note that this is virtually
identical to the approach used there for configuring a ServiceDelegate

As an added benefit we think this approach will make it easier to
build a JAX-RS implementation on a variety of IoC frameworks since the
API will no longer bake-in a specific factory approach beyond the
initial bootstrapping of the RuntimeDelegate implementation.

At the same time we also propose to remove the @Contract annotation.
This might have been useful in a general purpose IoC framework but for
JAX-RS the contracts are fixed and it adds no real value while adding
a source of confusion. We'll retain the @Provider annotation for
marking message body readers and writers.

If the above proves satisfactory it might also make sense to move the
MessageBodyReader, MessageBodyWriter and @Provider annotations to the
core package and then rename the ext package to spi.

Thoughts, comments ?


Marc Hadley <marc.hadley at>
CTO Office, Sun Microsystems.