dev@jsr311.java.net

Re: JSR311: ProviderFactory API needs a bit refactoring?

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 08 Nov 2007 15:27:03 -0500

Any further feedback on this before I make the change ? We'd like to
include this change in the 0.5 snapshot planned for the end of this
week to give the Jersey team a stable target.

Thanks,
Marc.

On Nov 8, 2007, at 12:54 AM, Liu, Jervis wrote:
>>>
>> Something like:
>>
>> public interface MessageBodyReader<T> {
>> boolean isReadable(Class<?> type);
>> T readFrom(Class<T> type, MediaType mediaType,
>> MultivaluedMap<String, String> httpHeaders,
>> InputStream entityStream) throws IOException;
>> }
>>
>> and
>>
>> public interface MessageBodyWriter<T> {
>> boolean isWriteable(Class<?> type);
>> void writeTo(T t, MediaType mediaType,
>> MultivaluedMap<String, Object> httpHeaders,
>> OutputStream entityStream) throws IOException;
>> long getSize(T t)
>> }
>>
>> with the corresponding:
>>
>> public abstract class ProviderFactory {
>> ...
>> public abstract <T> MessageBodyReader<T>
>> createMessageBodyReader(Class<T> type, MediaType media);
>> public abstract <T> MessageBodyWriter<T>
>> createMessageBodyWriter(Class<T> type, MediaType media);
>> }
>>
>
> This looks good. Thanks.
>
> Jervis

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