dev@jsr311.java.net

RE: JSR311: ProviderFactory API needs a bit refactoring?

From: Larry Cable <lcable_at_bea.com>
Date: Thu, 8 Nov 2007 12:48:19 -0800

+1



From: Marc Hadley
Sent: Thu 11/8/2007 12:27 PM
To: dev_at_jsr311.dev.java.net
Subject: Re: JSR311: ProviderFactory API needs a bit refactoring?


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.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
Notice:  This email message, together with any attachments, may contain information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,  copyrighted  and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.