users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: No way to disable a Feature

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 13 Dec 2011 18:13:56 +0100

On 12/13/2011 03:20 PM, Bill Burke wrote:
>
>
> On 12/13/11 6:11 AM, Marek Potociar wrote:
>>
>>
>> On 12/12/2011 03:48 PM, Bill Burke wrote:
>>> While the Feature interface has a onDisable() method, there's no way for the onDisable() method to be able to unregister
>>> providers. The Configuration.getProviderXXXX() methods return immutable sets.
>>
>> Please clarify - are you suggesting to remove onDisable() and deffer the disabling mechanism to the Feature
>> implementation or to add a common API for feature disabling?
>>
>
> I'll clarify. The Configuration interface has no way to unregister a provider at the moment.

To follow up, my assumption was that while a provider can be registered, disabling a feature does not mean the provider
is removed. I thought that it only means the feature will somehow set a "disabled" property, that will be checked by the
provider whenever it is invoked. That's why I thought that adding more mutability (to remove providers) is not
necessary. But if the above property-based solution for some reason is not sufficient or practical, we can add a couple
of remove methods for providers.

>
>>>
>>> Also, the Configuration.setProperty() method should state that if the property value is null, then this means to delete
>>> the property....OR...a removeProperty() method should be added.
>>
>> Can you (or anyone) think of a valid use case when a property can be expected to contain 'null' value? If not, I'll
>> update the setProperty(...) javadoc shortly.
>>
>
> Servlet spec works in the same way IIRC.
>

Btw. just pushed the javadoc change - please update.

Marek