Hi,
The question lurking here is the official API of the
MessageBodyReader. How does the interceptor choose the right class to
pass to it?
Have a look please at JAXRSUtils.readFromMessageBody()
One thing we may need to figure out is how AegisElementProvider can handle
isReadable/isWriteable.
If a user knows that it's only xml that flows in/out for a given application
then simply returning 'true' will be ok.
If more than one provider is involved, say Aegis one and Binary one then it
will become brittle.
One option is for Aegis provider to 'insist' that a given method is annotated with ProduceMime("application/xml") (or text/xml) and
it can be checked in isWriteable, while ConsumeMime("application/xml") can be checked in isReadable().
If none of these annotations exists then it can be checked if aegis.properties
are available.
Finally, we can have
@Context HttpHeaders hearders;
injected into your provider and you can check if ContentType contains "application/xml" in isReadable or Accept contains
"application/xml" in isWritable.
But as I said, for simple scenarious, the 'true' will do.
As a side note, would you mind excluding a cxf jaxb data binding dependency from the aegis one you added to the pom ? If we ever
need it then we will introduce it back, say if we manage to reuse some of the existing cxf jaxb code in the jaxrs runtime...For now
I'd like to keep the size of the cxf-jaxrs bundle which is generated in /distrubution to a minimum. The one which is currently
produced can be shrinked quite a bit too...
What do you think ?
Cheers, Sergey