users@jsr311.java.net

Re: ApplicationConfig vs. Application

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Wed, 30 Jul 2008 14:16:38 +0200

Hi Paul
>>> Since a class or instance of a class can be identified as a provider
>>> class or a root resource class from annotations on the class there
>>> is no need for separate methods.
>> This leads to another question, why are provider marked by an
>> annotation and why isn't there just a superinterface for
>> ExceptionMapper, ContextResolver, MessageBodyReader and
>> MessageBodyWriter. This would allow stronger typing:
>>
>> java.util.Set<java.lang.Class<Provider>> getProviderClasses()
>>
>> or, to allow greater flexibility to the Application
>>
>> java.util.Set<Provider> getProviders()
> We followed the same pattern as for root resource classes, mark the
> class of interest with an annotation (rather than a marker interface).
Every provider implements at least one interface (MessageBodyReader,
MessageBodyWriter, ContextResolver or ExceptionMapper), so no special
marker interface is needed.

best regards
   Stephan