dev@jsr311.java.net

Proposal for fixing issues 20 and 21

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

Experts,

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:

https://jsr311.dev.java.net/nonav/sketches/delegate/index.html

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:

https://jsr311.dev.java.net/nonav/sketches/delegate/javax/ws/rs/ext/RuntimeDelegate.html
#getInstance()

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

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.

[1] https://jsr311.dev.java.net/issues/show_bug.cgi?id=20
[2] https://jsr311.dev.java.net/issues/show_bug.cgi?id=21

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