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

        Gerhard Petracek created issue -
        Gerhard Petracek made changes -
        Field Original Value New Value
        Component/s Core [ 12317002 ]
        Gerhard Petracek made changes -
        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> T getContextualReference(Bean<T> bean, boolean optionalBeanAllowed, Class<T> targetType)

        public <T> List<T> getContextualReferences(Class<T> type, boolean optionalBeanAllowed, Annotation... qualifiers)
        Gerhard Petracek made changes -
        Assignee Gerhard Petracek [ gpetracek ] Mark Struberg [ struberg ]
        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.
        Mark Struberg made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        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
        Mark Struberg made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 0.1-SNAPSHOT [ 12319286 ]
        Resolution Fixed [ 1 ]
        Hide
        Gerhard Petracek added a comment -

        #getContextualReferences is missing

        Show
        Gerhard Petracek added a comment - #getContextualReferences is missing
        Gerhard Petracek made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Gerhard Petracek made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Gerhard Petracek made changes -
        Summary move util methods to CdiUtils move util methods to BeanProvider
        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> T getContextualReference(Bean<T> bean, boolean optionalBeanAllowed, Class<T> targetType)

        public <T> List<T> getContextualReferences(Class<T> type, boolean optionalBeanAllowed, Annotation... qualifiers)
        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)
        Gerhard Petracek made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development