Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1-incubating
    • Component/s: Core
    • Labels:
      None

      Description

      public <T> T getContextualReference(Class<T> type, boolean optionalBeanAllowed, Annotation... qualifiers)
      public <T> T getContextualReference(String name, boolean optionalBeanAllowed, Class<T> targetType)

      public <T> List<T> getContextualReferences(Class<T> type, boolean optionalBeanAllowed, Annotation... qualifiers)

        Activity

        Hide
        Jason Porter added a comment -

        What's the optionalBeanAllowed param drive?

        Show
        Jason Porter added a comment - What's the optionalBeanAllowed param drive?
        Hide
        Gerhard Petracek added a comment -

        if you provide a name, type,... and there is no cdi bean for it the behaviour is different.
        optionalBeanAllowed == false && cdiBeanFound == false -> throw an exception
        optionalBeanAllowed == true && cdiBeanFound == false -> return null

        the alternative would be to return null and every caller has to do the exception part (if a cdi bean isn't optional) -> we will see different exceptions for the same reason.

        Show
        Gerhard Petracek added a comment - if you provide a name, type,... and there is no cdi bean for it the behaviour is different. optionalBeanAllowed == false && cdiBeanFound == false -> throw an exception optionalBeanAllowed == true && cdiBeanFound == false -> return null the alternative would be to return null and every caller has to do the exception part (if a cdi bean isn't optional) -> we will see different exceptions for the same reason.
        Hide
        Jason Porter added a comment -

        Okay, got it, thanks.

        Show
        Jason Porter added a comment - Okay, got it, thanks.
        Hide
        Mark Struberg added a comment -

        CdiUtils sounds a bit too loose. I'd rather name it ContextualInstanceProvider and let it resolve the BeanManager internally.

        Show
        Mark Struberg added a comment - CdiUtils sounds a bit too loose. I'd rather name it ContextualInstanceProvider and let it resolve the BeanManager internally.
        Hide
        Mark Struberg added a comment -

        resolved as part of the work for DELTASPIKE-17

        Show
        Mark Struberg added a comment - resolved as part of the work for DELTASPIKE-17
        Hide
        Gerhard Petracek added a comment -

        #getContextualReferences is missing

        Show
        Gerhard Petracek added a comment - #getContextualReferences is missing

          People

          • Assignee:
            Mark Struberg
            Reporter:
            Gerhard Petracek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development