CDI: Make marking DefaultContextAssociationManager$RequestScopedAssociation bean as unremovable more robust

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: L3 - Default
    • 7.16.0, 7.16.0-alpha4
    • Affects Version/s: None
    • Component/s: quarkus
    • None

      AC

      • Solution ideas are investigated how to mark the DefaultContextAssociationManager$RequestScopedAssociation bean from engine-cdi as an unremovable bean in a more robust way
      • The best idea is implemented

      Hints

      Currently, the name of the bean is partially hardcoded:

        @BuildStep
        protected void unremovableBeans(BuildProducer<UnremovableBeanBuildItem> unremovableBeansProducer) {
          unremovableBeansProducer.produce(
              UnremovableBeanBuildItem.beanTypes(
                  DotName.createSimple(DefaultContextAssociationManager.class.getName() + "$RequestScopedAssociation")));
        }
      

      Solution idea

      Move DefaultContextAssociationManager$RequestScopedAssociation and DefaultContextAssociationManager$ScopedAssociation to dedicated classes. Like this, we can reference the RequestScopedAssociation directly. DefaultContextAssociationManager is private API so we can change the class structure. Creating dedicated classes does not have any impact behaviorally. For consistency reasons, let's also move DefaultContextAssociationManager$ConversationScopedAssociation to a dedicated class.

            Assignee:
            Tassilo Weidner-Mühl
            Reporter:
            Tassilo Weidner-Mühl
            Tassilo Weidner-Mühl Tassilo Weidner-Mühl
            Nikola Koevski Nikola Koevski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: