Issue 43[1] resulted from some internal feedback that it would be
useful to be able to use existing java activation framework (JAF)
DataContentHandlers with JAX-RS rather than force people to rewrite
them as MessageBodyReaders and Writers.
For example, given a resource method:
@POST
Foo getFoo(Bar bar) {...}
An implementation could make use of an existing handler to deserialize
the request along the following lines.
DataHandler dh = new DataHandler(dataSource);
DataFlavor df[] = dh.getTransferDataFlavors();
DataFlavor barDataFlavor = findMatchingFlavor(Bar.class, df);
Bar = (Bar)dh.getTransferData(barDataFlavor);
JAF isn't as flexible as JAX-RS entity providers (there's no access to
annotations, generic type, other headers etc) so I think it should be
supported as a fallback when a suitable MessageBodyReader or Writer
can't be found.
Thoughts, comments ?
Marc.
---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.
[1] https://jsr311.dev.java.net/issues/show_bug.cgi?id=43