Felix
  1. Felix
  2. FELIX-1416

Wrong factory configuration behaviour

    Details

      Description

      Currently factory configurations are applied to component factories, such that each factory configuration instance creates a componnent
      instances of a component factory. Reversly deleting a factory configuration also deletes component instances. This is not how it is specified.

      Correct is, that

      (1) Component Factories can only be configured with singleton configurations applying
      the configuration to all instances created with newInstance
      (2) Factory configurations are applied to non-component-factory components and
      cause multiple component instances to be created.

      To accomodate for this, the handling of components has to be redesigned: A component descriptor now causes the creation of a ComponentHolder. Depending on configuration availability a ComponentHolder will hold a single component (no configuration or singleton configuration) or multiple components (factory configuration).

        Issue Links

          Activity

          Felix Meschberger created issue -
          Hide
          Felix Meschberger added a comment -

          Added unit and integration (Pax Exam based) tests for the fixed configuration behaviour in Rev. 798522

          In Rev. 798529 adapted the ImmediateComponentManager to the new holder mechanism.

          Rev. 798531 finally brings the big block of ComponentHolder and implementation.

          The ComponentRegistry is refactored to be a factory for ComponentHolders and has no Configuration support. The ConfigurationComponentRegistry extends the ComponentRegistry adding support for Configuration from ConfigurationAdmin.

          For ComponentFactory components the ComponentFactoryImpl also acts as the component holder. For Components without configuration (configuration-policy=ignore) UnconfiguredComponentHolder instances are used. This class is also used if no ConfigurationAdmin service is available.

          For components taking configuration the ConfiguredComponentHolder class is used. This class can cope with singleton and factory configurations.

          The Configuration policy "ignore" is handled by the ComponentRegistry in that an UnconfiguredComponentHolder is created to hold the component without ever forwarding configuration.

          For Configuration policy "require" and "optional" a ConfiguredComponentHolder is used. The "require" policy is handled by the AbstractComponentManager to prevent activation if there is no configuration.

          Show
          Felix Meschberger added a comment - Added unit and integration (Pax Exam based) tests for the fixed configuration behaviour in Rev. 798522 In Rev. 798529 adapted the ImmediateComponentManager to the new holder mechanism. Rev. 798531 finally brings the big block of ComponentHolder and implementation. The ComponentRegistry is refactored to be a factory for ComponentHolders and has no Configuration support. The ConfigurationComponentRegistry extends the ComponentRegistry adding support for Configuration from ConfigurationAdmin. For ComponentFactory components the ComponentFactoryImpl also acts as the component holder. For Components without configuration (configuration-policy=ignore) UnconfiguredComponentHolder instances are used. This class is also used if no ConfigurationAdmin service is available. For components taking configuration the ConfiguredComponentHolder class is used. This class can cope with singleton and factory configurations. The Configuration policy "ignore" is handled by the ComponentRegistry in that an UnconfiguredComponentHolder is created to hold the component without ever forwarding configuration. For Configuration policy "require" and "optional" a ConfiguredComponentHolder is used. The "require" policy is handled by the AbstractComponentManager to prevent activation if there is no configuration.
          Hide
          Felix Meschberger added a comment -

          This fixes this issue.

          Show
          Felix Meschberger added a comment - This fixes this issue.
          Felix Meschberger made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Felix Meschberger made changes -
          Link This issue relates to FELIX-924 [ FELIX-924 ]
          Felix Meschberger made changes -
          Link This issue is required by SLING-408 [ SLING-408 ]
          Hide
          Felix Meschberger added a comment -

          SCR 1.2.0 has been released. Close all issues.

          Show
          Felix Meschberger added a comment - SCR 1.2.0 has been released. Close all issues.
          Felix Meschberger made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Felix Meschberger added a comment -

          Some update for reference purposes.

          The fixes for this issue change the behaviour of Component Factory support in a non-backwards-compatible (yet spec compliant way). For applications depending on the non-compliant behaviour of creating Component Factory component instances with factory configuration a configuration property – ds.factory.enabled – has been added.

          If this property is set to true, factory configurations will create Component Factroy component instances.

          If this property is not set or set to any value other than true, Component Factory component instances must be created calling the ComponentFactory.newInstance method.

          Show
          Felix Meschberger added a comment - Some update for reference purposes. The fixes for this issue change the behaviour of Component Factory support in a non-backwards-compatible (yet spec compliant way). For applications depending on the non-compliant behaviour of creating Component Factory component instances with factory configuration a configuration property – ds.factory.enabled – has been added. If this property is set to true, factory configurations will create Component Factroy component instances. If this property is not set or set to any value other than true, Component Factory component instances must be created calling the ComponentFactory.newInstance method.

            People

            • Assignee:
              Felix Meschberger
              Reporter:
              Felix Meschberger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development