jersey
  1. jersey
  2. JERSEY-1602

Configuration.register does not register Feature

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Works as designed
    • Affects Version/s: 2.0-m10
    • Fix Version/s: 2.0-m11, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      Client client = ClientFactory.newClient();
      final Configuration fullConfig = client.configuration();		
      fullConfig.register(new Feature() {
      	@Override
      	public boolean configure(Configurable arg0) {
      		return true;
      	}
      });
      System.out.println(fullConfig.getFeatures().size()); //prints 0
      

        Activity

        Hide
        Michal Gajdos added a comment -

        This behaviour is correct according to the javadoc:

        The returned set contains the features that have already been successfully
        {@link Feature#configure(Configurable) configured} in this configuration context.
        

        Note: Feature}}s are not immediately configured when they are passed to the {{Configuration so Configuration#getFeatures() cannot return anything else than an empty set.

        Configuration/Configurable functionality has been refactored A LOT in the latest milestones/snapshots of the spec, see:

        http://jax-rs-spec.java.net/nonav/2.0-SNAPSHOT/apidocs/javax/ws/rs/core/Configuration.html
        http://jax-rs-spec.java.net/nonav/2.0-SNAPSHOT/apidocs/javax/ws/rs/client/Configurable.html

        Show
        Michal Gajdos added a comment - This behaviour is correct according to the javadoc: The returned set contains the features that have already been successfully {@link Feature#configure(Configurable) configured} in this configuration context. Note: Feature}}s are not immediately configured when they are passed to the {{Configuration so Configuration#getFeatures() cannot return anything else than an empty set. Configuration / Configurable functionality has been refactored A LOT in the latest milestones/snapshots of the spec, see: http://jax-rs-spec.java.net/nonav/2.0-SNAPSHOT/apidocs/javax/ws/rs/core/Configuration.html http://jax-rs-spec.java.net/nonav/2.0-SNAPSHOT/apidocs/javax/ws/rs/client/Configurable.html

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            jan.supol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: