javax.ws.rs.core
Interface Feature

All Known Implementing Classes:
BrowserCacheFeature, ServerCacheFeature

public interface Feature

A feature extension contract. Typically encapsulates a concept that involves configuration of multiple providers (e.g. filters or interceptors) and/or properties.

A Feature is a special type of JAX-RS configuration provider that, if registered, it's configure(Configurable) method is invoked during JAX-RS runtime configuration and bootstrapping phase with goal to further configure the runtime scope in which it has been registered. From within the invoked configure(...) method a feature may provide additional runtime configuration for the domain it represents, such as registering additional contract providers, including nested features and/or specifying domain-specific properties.

Since:
2.0
Author:
Marek Potociar

Method Summary
 boolean configure(Configurable configurable)
          A call-back method called when the feature is to be enabled in a given configurable scope.
 

Method Detail

configure

boolean configure(Configurable configurable)
A call-back method called when the feature is to be enabled in a given configurable scope. The responsibility of the feature is to properly update the supplied configurable context and return true if the feature was successfully enabled or false otherwise.

Note that under some circumstances the feature may decide not to enable itself, which is indicated by returning false. In such case the configurable context does not internally register the feature in the collection of enabled features and the attempt to enable the feature is ignored.

Parameters:
configurable - configurable context in which the feature should be enabled.
Returns:
true if the feature was successfully enabled, false otherwise.


Copyright © 2013. All Rights Reserved.