javax.ws.rs.core

Interface Feature


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

    A Feature is a special type of JAX-RS configuration meta-provider. Once a feature is registered, it's configure(FeatureContext) method is invoked during JAX-RS runtime configuration and bootstrapping phase allowing the feature to further configure the runtime context in which it has been registered. From within the invoked configure(...) method a feature may provide additional runtime configuration for the facility or conceptual 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 Detail

      • configure

        boolean configure(FeatureContext context)
        A call-back method called when the feature is to be enabled in a given runtime configuration scope. The responsibility of the feature is to properly update the supplied runtime configuration 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 configuration context does not add the feature to the collection of enabled features and a subsequent call to Configuration.isEnabled(Feature) or Configuration.isEnabled(Class) method would return false.

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

Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/ws/rs/core/Feature.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : https://docs.oracle.com, Feature (Java(TM) EE 7 Specification APIs)

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.